Support Iceberg default warehouse location config#9614
Support Iceberg default warehouse location config#9614jackye1995 wants to merge 1 commit intotrinodb:masterfrom
Conversation
|
In Iceberg, I can define |
d14bf0f to
cff436a
Compare
There are 2 reasons for this config:
|
findepi
left a comment
There was a problem hiding this comment.
Add a test covering creation of tables without location, within schema without location set.
This is what becomes possible with this change.
There was a problem hiding this comment.
Make the property Optional<String>
There was a problem hiding this comment.
not sure about the name. something like "default storage location"?
There was a problem hiding this comment.
This is to match https://github.com/apache/iceberg/blob/master/core/src/main/java/org/apache/iceberg/CatalogProperties.java#L31. Please let me know if other name is preferred, I can update to that.
There was a problem hiding this comment.
For schemas and tables we use "location". So probably we should use it also here. iceberg.default-schema-location?
There was a problem hiding this comment.
This should be named more meaningfully. Let's figure config property name first.
There was a problem hiding this comment.
sure, I updated to catalogWarehouse for now
There was a problem hiding this comment.
Let's not build a fake Database object.
Instead, let's modify getTableDefaultLocation (which already has related logic).
There was a problem hiding this comment.
This is to match https://github.com/apache/iceberg/blob/master/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java#L433-L440, not sure if Trino has any preference for this
|
@findepi test is actually quite difficult to add, the file metastore has a hard-coded database location, so that code path would never be exercised. Not sure if there is any other good way to trigger that. |
|
We can also choose to not have this feature for Hive catalog and only support it with Hadoop and Glue catalog, because based on the current logic of |
cff436a to
06b11fa
Compare
|
close in favor of #10151 |
The link no longer seems to be adequate. @jackye1995 can you link to a file in a commit, instead of a branch? |
Support using a configurable warehouse location to determine the default table location.
This is to match the Iceberg side catalog behavior: https://github.com/apache/iceberg/blob/master/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java#L452-L459.
@losipiuk @findepi