youngxinler commented on code in PR #6886:
URL: https://github.com/apache/iceberg/pull/6886#discussion_r1111837244
##########
spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/SparkCatalog.java:
##########
@@ -127,6 +128,16 @@ protected Catalog buildIcebergCatalog(String name,
CaseInsensitiveStringMap opti
optionsMap.putAll(options.asCaseSensitiveMap());
optionsMap.put(CatalogProperties.APP_ID,
SparkSession.active().sparkContext().applicationId());
optionsMap.put(CatalogProperties.USER,
SparkSession.active().sparkContext().sparkUser());
+ if (conf.get(CatalogProperties.WAREHOUSE_LOCATION) != null) {
+ optionsMap.put(
+ CatalogProperties.WAREHOUSE_LOCATION,
conf.get(CatalogProperties.WAREHOUSE_LOCATION));
+ } else if (optionsMap.get(StaticSQLConf.WAREHOUSE_PATH().key()) != null) {
+ // if spark.sql.catalog.$catalogName.warehouse no setting, will try use
+ // spark.sql.warehouse.dir as catalog warehouse.
+ optionsMap.put(
+ CatalogProperties.WAREHOUSE_LOCATION,
+ optionsMap.get(StaticSQLConf.WAREHOUSE_PATH().key()));
+ }
Review Comment:
Supports `spark.sql.warehouse.dir` and assumes that
`spark.sql.catalog.$catalogName.warehouse` is preferred.
I think it is more general to pass the warehouse path through
`CatalogProperties.WAREHOUSE_LOCATION`?
Because both `HadoopCatalog` and `HiveCatalog` are adapted to
`CatalogProperties.WAREHOUSE_LOCATION`.
> StaticSQLConf.WAREHOUSE_PATH().key() = spark.sql.warehouse.dir
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]