-
Notifications
You must be signed in to change notification settings - Fork 3k
Core: Add view-override catalog property
#12534
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
Core: Add view-override catalog property
#12534
Conversation
smaheshwar-pltr
left a comment
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.
This is looking great to me - thank you @ebyhr for driving these features!
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java
Outdated
Show resolved
Hide resolved
| @Override | ||
| public Table create() { | ||
| Endpoint.check(endpoints, Endpoint.V1_CREATE_TABLE); | ||
| propertiesBuilder.putAll(tableOverrideProperties()); |
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.
Nit from me (feel free to ignore): I wonder whether some private buildProperties: Map<String, String> method that puts overrides and calls buildKeepingLast to be used in the various terminal methods of this class is cleaner, but not sure.
| Table table = | ||
| catalog() | ||
| .buildTable(ident, SCHEMA) | ||
| .withProperty("override-key4", "catalog-overridden-key4") |
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.
Extreme nit: these tests look great but I'm bad at reading so at first was confused by this 😄. Could rename value here and elsewhere to table-key4 / view-key4 to be super explicit but do feel free to ignore
| .put( | ||
| CatalogProperties.TABLE_DEFAULT_PREFIX + "override-key3", | ||
| "catalog-default-key3") |
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.
Hmm I realise this has been done for previous PRs so can look past this, but I wonder whether, given these catalog properties are specific to CatalogTests, are required for them to pass, and aren't specific to individual catalogs, they should instead be provided on the CatalogTests themselves somehow instead of being hardcoded strings in each initialisation of the XCatalogTest subclasses.
Maybe: Could provide some CATALOG_PROPERTIES map containing them on CatalogTests that subclasses are contracted to initialise respective catalogs with (along with those specific to that catalog e.g. JDBC username / password).
2ac9a10 to
9e986a2
Compare
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/iceberg/view/BaseMetastoreViewCatalog.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/apache/iceberg/inmemory/TestInMemoryViewCatalog.java
Show resolved
Hide resolved
view-override catalog property + fix missing table-override property in REST catalogview-override catalog property
f7486df to
fa3e3a3
Compare
nastra
left a comment
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.
thanks @ebyhr for working on this
fa3e3a3 to
09592c2
Compare
|
@ebyhr could you also please add some docs to https://github.com/apache/iceberg/blob/25e7897b1161d5548ff428e0ec9016d5934635a1/docs/docs/spark-configuration.md#catalog-configuration for this new property? |
|
@nastra Sure, added a new commit documenting the property. |
Add support for
view-overridecatalog property.