diff --git a/geomesa-gt/geomesa-gt-partitioning/src/main/scala/org/locationtech/geomesa/gt/partition/postgis/PartitionedPostgisDataStoreFactory.scala b/geomesa-gt/geomesa-gt-partitioning/src/main/scala/org/locationtech/geomesa/gt/partition/postgis/PartitionedPostgisDataStoreFactory.scala index 14dc1458cf44..b808a3d2b474 100644 --- a/geomesa-gt/geomesa-gt-partitioning/src/main/scala/org/locationtech/geomesa/gt/partition/postgis/PartitionedPostgisDataStoreFactory.scala +++ b/geomesa-gt/geomesa-gt-partitioning/src/main/scala/org/locationtech/geomesa/gt/partition/postgis/PartitionedPostgisDataStoreFactory.scala @@ -44,8 +44,15 @@ class PartitionedPostgisDataStoreFactory extends PostgisNGDataStoreFactory with source } - override protected def createDataStoreInternal(store: JDBCDataStore, params: java.util.Map[String, _]): JDBCDataStore = { - + override protected def createDataStoreInternal(store: JDBCDataStore, baseParams: java.util.Map[String, _]): JDBCDataStore = { + val params = new java.util.HashMap[String, Any](baseParams) + // set default schema, if not specified - postgis store doesn't actually use its own default + if (!params.containsKey(PostgisNGDataStoreFactory.SCHEMA.key)) { + // need to set it in the store, as the key has already been processed + store.setDatabaseSchema("public") + // also set in the params for consistency, although it's not used anywhere + params.put(PostgisNGDataStoreFactory.SCHEMA.key, "public") + } val ds = super.createDataStoreInternal(store, params) val dialect = new PartitionedPostgisDialect(ds) diff --git a/geomesa-gt/geomesa-gt-partitioning/src/test/scala/org/locationtech/geomesa/gt/partition/postgis/PartitionedPostgisDataStoreTest.scala b/geomesa-gt/geomesa-gt-partitioning/src/test/scala/org/locationtech/geomesa/gt/partition/postgis/PartitionedPostgisDataStoreTest.scala index befca791c034..de6ed3bf17e4 100644 --- a/geomesa-gt/geomesa-gt-partitioning/src/test/scala/org/locationtech/geomesa/gt/partition/postgis/PartitionedPostgisDataStoreTest.scala +++ b/geomesa-gt/geomesa-gt-partitioning/src/test/scala/org/locationtech/geomesa/gt/partition/postgis/PartitionedPostgisDataStoreTest.scala @@ -77,7 +77,6 @@ class PartitionedPostgisDataStoreTest extends Specification with BeforeAfterAll "dbtype" -> PartitionedPostgisDataStoreParams.DbType.sample, "host" -> host, "port" -> port, - "schema" -> schema, "database" -> "postgres", "user" -> "postgres", "passwd" -> "postgres",