Skip to content

Commit

Permalink
GEOMESA-3294 Partitioned PostGIS - use default database schema if not…
Browse files Browse the repository at this point in the history
… specified
  • Loading branch information
elahrvivaz committed Sep 19, 2023
1 parent 8f7206f commit 9914f97
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 9914f97

Please sign in to comment.