-
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
Add support for case-insensitive object names in Iceberg REST catalog #23867
Add support for case-insensitive object names in Iceberg REST catalog #23867
Conversation
...ino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/IcebergRestCatalogConfig.java
Show resolved
Hide resolved
...eberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/TrinoIcebergRestCatalogFactory.java
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/TrinoRestCatalog.java
Outdated
Show resolved
Hide resolved
...va/io/trino/plugin/iceberg/catalog/rest/TestIcebergPolarisCatalogCaseInsensitiveMapping.java
Outdated
Show resolved
Hide resolved
...va/io/trino/plugin/iceberg/catalog/rest/TestIcebergPolarisCatalogCaseInsensitiveMapping.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/TrinoRestCatalog.java
Outdated
Show resolved
Hide resolved
...va/io/trino/plugin/iceberg/catalog/rest/TestIcebergPolarisCatalogCaseInsensitiveMapping.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/TrinoRestCatalog.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/TrinoRestCatalog.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/TrinoRestCatalog.java
Outdated
Show resolved
Hide resolved
a5c27dc
to
83ca21d
Compare
...eberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/TrinoIcebergRestCatalogFactory.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/TrinoRestCatalog.java
Outdated
Show resolved
Hide resolved
181d065
to
6a5a081
Compare
ran newly added tests by modifying ci.yml. All of the one of the |
6e7a8ee
to
4af6c9d
Compare
Could you rebase on master to resolve conflicts and squash commits into one? |
3d5c74e
to
d247654
Compare
@ebyhr CI is passing with squashed commits. |
@ebyhr gentle reminder to review this PR. |
d247654
to
68fd499
Compare
Sorry for my delayed review. Just rebased on master without any changes. I guess there is a logical conflict with #23986. |
I think nested namespace support is broken most likely due to apache/iceberg#10858 (comment) I guess Meanwhile, do you see any issues if I change |
@mayankvadariya You can use single-level instead. |
ca3835a
to
ed61139
Compare
@ebyhr CI is green. Please review. |
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/TrinoRestCatalog.java
Outdated
Show resolved
Hide resolved
return remoteView; | ||
} | ||
else if (remoteView.name().equals(schemaTableName.getTableName()) && remoteTable.name().equals(schemaTableName.getTableName())) { | ||
return remoteTable; // table name and view name are same |
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.
table name and view name are same
Which metastore supports registering an object as both table and view?
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.
Comment seems bit confusing. I'll remove it.
Idea is
- first if will return if remote table name is different. It may be the case if case-sensitive matching is enabled.
- second if will return if remote view name is different. It may be the case if case-sensitive matching is enabled.
- last if will return if remote view and remote table are same. Here, remote table and view name same doesn't imply that remote has table and/or view exist.
Rather it implies thattoRemoteView
andtoRemoteTable
returned same TableIdentifier as that of passedschemaTableName
. It happens(throughtoRemoteObject
) when either remote has same table/view name when case-sensitive is enabled or when case-sensitive is disabled.
fyi - In last if, I've ignored comparing remoteTable.namespace()
and remoteTable.namespace()
as those are expected to be same as toRemoteTable
and toRemoteView
relies on findRemoteNamespace
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/TrinoRestCatalog.java
Outdated
Show resolved
Hide resolved
...va/io/trino/plugin/iceberg/catalog/rest/TestIcebergPolarisCatalogCaseInsensitiveMapping.java
Outdated
Show resolved
Hide resolved
ed61139
to
b101640
Compare
@ebyhr please advise if you have access to rerun the timed out jobs. If not, I can force push to start a new pipeline. |
af8074d
to
bbb9834
Compare
CI has successfully passed. |
Certain Rest catalog implementation such as Polaris supports case-sensitive object(namespace, table, view etc.) names. This change allows querying mixed/upper case letter object names in rest catalog from Trino. `iceberg.rest-catalog.case-insensitive-name-matching` controls whether to match lowercase object names in Trino with different case object names in rest catalog with the limitations that only single object name with the identical name is supported.
b047c90
to
6d8163a
Compare
Certain Rest catalog implementation(eg. Polaris) supports case-sensitive object(namespace, table, view etc.) names. This change allows querying mixed/upper case letter objects in rest catalog from Trino.
iceberg.rest-catalog.case-insensitive-name-matching
controls whether to match lowercase object names in Trino with different case object names in rest catalog with the limitations that only single object name with the same name is supported.Fixes #23715
Release notes