-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix table props for Iceberg with orc_bloom_filter #20433
Conversation
387bc46
to
24bb55b
Compare
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergUtil.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergUtil.java
Outdated
Show resolved
Hide resolved
@@ -662,8 +687,8 @@ public static Map<String, String> createTableProperties(ConnectorTableMetadata t | |||
if (!columns.isEmpty()) { | |||
checkFormatForProperty(fileFormat.toIceberg(), FileFormat.ORC, ORC_BLOOM_FILTER_COLUMNS); | |||
validateOrcBloomFilterColumns(tableMetadata, columns); | |||
propertiesBuilder.put(ORC_BLOOM_FILTER_COLUMNS_KEY, Joiner.on(",").join(columns)); | |||
propertiesBuilder.put(ORC_BLOOM_FILTER_FPP_KEY, String.valueOf(getOrcBloomFilterFpp(tableMetadata.getProperties()))); | |||
propertiesBuilder.put(TableProperties.ORC_BLOOM_FILTER_COLUMNS, Joiner.on(",").join(columns)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
io.trino.plugin.iceberg.IcebergTableProperties.ORC_BLOOM_FILTER_COLUMNS
org.apache.iceberg.TableProperties.ORC_BLOOM_FILTER_COLUMNS
We have a name conflict here so we can't static import both.
I thought about refactor the mapping logic between Trino session properties and Iceberg table properties.
The current mapping logic is a bit messy and across multiple classes.
However, the changes will be big so it's better to do it in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oneonestar What do you think about suffixing the ORC Trino session properties with _PROPERTY (as is already done with the other properties) and importing ORC_BLOOM_FILTER_COLUMNS and ORC_BLOOM_FILTER_FPP from org.apache.iceberg.TableProperties into IcebergTableProperties, and then importing them here?
This approach would maintain the pattern that already exists, and it would make things easier for me in the #20393 PR to add the constant that holds the iceberg table properties.
Subsequently, we could revisit how we deal with both kinds of properties.
What are your thoughts on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ndrluis Thanks for the suggestion.
Rename Trino session properties with _PROPERTY
make a lot of sense.
importing ORC_BLOOM_FILTER_COLUMNS and ORC_BLOOM_FILTER_FPP from org.apache.iceberg.TableProperties into IcebergTableProperties, and then importing them here?
I don't understand why these properties are needed in IcebergTableProperties.
I did the change in eddb7e8 . Please take a look.
LGTM % comments |
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergMetadata.java
Outdated
Show resolved
Hide resolved
459934b
to
eddb7e8
Compare
plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergOrcWithBloomFilters.java
Outdated
Show resolved
Hide resolved
42ffcff
to
2e67cda
Compare
2e67cda
to
56e5374
Compare
This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua |
Description
This PR fix table properties for Iceberg table with orc_bloom_filter:
Fix #20432
Additional context and related issues
The correct table properties should be:
orc.bloom.filter.columns
->write.orc.bloom.filter.columns
orc.bloom.filter.fpp
->write.orc.bloom.filter.fpp
.Spec: https://iceberg.apache.org/docs/latest/configuration/#write-properties
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
(x) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: