-
Notifications
You must be signed in to change notification settings - Fork 407
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
[#4718] fix(iceberg): use unified logic to transform catalog backend name to handle the renaming of catalog #4900
Conversation
docs/lakehouse-iceberg-catalog.md
Outdated
| `catalog-backend` | Catalog backend of Gravitino Iceberg catalog. Supports `hive` or `jdbc` or `rest`. | (none) | Yes | 0.2.0 | | ||
| `uri` | The URI configuration of the Iceberg catalog. `thrift://127.0.0.1:9083` or `jdbc:postgresql://127.0.0.1:5432/db_name` or `jdbc:mysql://127.0.0.1:3306/metastore_db` or `http://127.0.0.1:9001`. | (none) | Yes | 0.2.0 | | ||
| `warehouse` | Warehouse directory of catalog. `file:///user/hive/warehouse-hive/` for local fs or `hdfs://namespace/hdfs/path` for HDFS. | (none) | Yes | 0.2.0 | | ||
| `catalog-backend-name` | The catalog name passed to underlying Iceberg catalog backend. Catalog name in JDBC backend is used to isolate namespace and tables. | `catalog-backend` property value. | No | 0.5.2 | |
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.
The default value is "catalog-backend" or "catalog-backend
property value".
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.
The property value of catalog-backend
, and add an example
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.
Is it better to use only values like catalog-backend
?
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.
seems a little odd to use catalog-backend
for a catalog name
String catalogBackend = catalogProperties.get(IcebergConstants.CATALOG_BACKEND); | ||
return Optional.ofNullable(catalogBackend) | ||
.map(s -> s.toLowerCase(Locale.ROOT)) | ||
.orElse("memory"); |
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.
What's the meaning of the default value `memory"?
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.
the default catalog backend is memory
.../main/java/org/apache/gravitino/trino/connector/catalog/iceberg/IcebergConnectorAdapter.java
Show resolved
Hide resolved
| `catalog-backend` | Catalog backend of Gravitino Iceberg catalog. Supports `hive` or `jdbc` or `rest`. | (none) | Yes | 0.2.0 | | ||
| `uri` | The URI configuration of the Iceberg catalog. `thrift://127.0.0.1:9083` or `jdbc:postgresql://127.0.0.1:5432/db_name` or `jdbc:mysql://127.0.0.1:3306/metastore_db` or `http://127.0.0.1:9001`. | (none) | Yes | 0.2.0 | | ||
| `warehouse` | Warehouse directory of catalog. `file:///user/hive/warehouse-hive/` for local fs or `hdfs://namespace/hdfs/path` for HDFS. | (none) | Yes | 0.2.0 | | ||
| `catalog-backend-name` | The catalog name passed to underlying Iceberg catalog backend. Catalog name in JDBC backend is used to isolate namespace and tables. | The property value of `catalog-backend`, like `jdbc` for JDBC catalog backend. | No | 0.5.2 | | ||
|
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.
Is the default catalog backend memory
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.
It depondes on catalog-backend
, not memory
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.
LGTM
…name to handle the renaming of catalog (#4900) ### What changes were proposed in this pull request? 1. Spark,Trino, Iceberg catalog and Iceberg REST server use `getCatalogBackendName` to get catalog backend name. 2. change the default backend name to catalog backend, like `jdbc`, it will not change after rename. ### Why are the changes needed? Fix: #4718 ### Does this PR introduce _any_ user-facing change? Yes ### How was this patch tested? 1. create a jdbc catalog with catalog backend name, check whether can see the schema after rename 1. create a jdbc catalog without catalog backend name, check whether can see the schema after rename
What changes were proposed in this pull request?
getCatalogBackendName
to get catalog backend name.jdbc
, it will not change after rename.Why are the changes needed?
Fix: #4718
Does this PR introduce any user-facing change?
Yes
How was this patch tested?