-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 support for view-default
property in catalog
#11064
base: main
Are you sure you want to change the base?
Conversation
a0ed40f
to
a130aaa
Compare
a130aaa
to
2d41458
Compare
c4aa6ae
to
1b935cb
Compare
CI hit #10172 |
@RussellSpitzer Can you review this PR when you have time? |
1b935cb
to
8206c5f
Compare
core/src/test/java/org/apache/iceberg/view/ViewCatalogTests.java
Outdated
Show resolved
Hide resolved
@@ -29,6 +29,7 @@ private CatalogProperties() {} | |||
public static final String WAREHOUSE_LOCATION = "warehouse"; | |||
public static final String TABLE_DEFAULT_PREFIX = "table-default."; | |||
public static final String TABLE_OVERRIDE_PREFIX = "table-override."; | |||
public static final String VIEW_DEFAULT_PREFIX = "view-default."; |
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.
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.
That probably makes sense since we have the table-default as well, but i have no problem this being in a followup
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions. |
@ebyhr are you still working on this? |
@nastra Yes, I was actually waiting for next review round. |
@@ -85,6 +86,7 @@ public String name() { | |||
@Override | |||
public void initialize(String name, Map<String, String> properties) { | |||
this.catalogName = name != null ? name : InMemoryCatalog.class.getSimpleName(); | |||
this.catalogProperties = ImmutableMap.copyOf(properties); |
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.
Careful here, ImmutableMap.copyOf isn't null safe
@@ -94,6 +96,11 @@ public void initialize(String name, Map<String, String> properties) { | |||
closeableGroup.setSuppressCloseFailure(true); | |||
} | |||
|
|||
@Override | |||
protected Map<String, String> properties() { | |||
return catalogProperties == null ? ImmutableMap.of() : catalogProperties; |
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.
Depending on what you do above this may or may not be necessary
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.
I think this is still needed in case initialize()
hasn't been called
core/src/test/java/org/apache/iceberg/view/ViewCatalogTests.java
Outdated
Show resolved
Hide resolved
@@ -1200,6 +1200,8 @@ private RESTViewBuilder(SessionContext context, TableIdentifier identifier) { | |||
checkViewIdentifierIsValid(identifier); | |||
this.identifier = identifier; | |||
this.context = context; | |||
properties.putAll( |
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.
I'm surprised that the same isn't done for tables. Can you please double-check whether default/override properties properly work with the rest catalog?
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.
I checked and it seems this change here isn't necessary because the default properties will be set on the server when the view builder is used
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.
RESTCompatibilityKitViewCatalogTests
starts failing due to lack of default properties without this change. Should I revert or update the different place?
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.
in that case maybe we should set the default props here too, but it would be good to investigate why this isn't necessary for tables
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.
@ebyhr did you have a chance looking into 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.
@nastra Perhaps, we need a similar change for tables. The new CatalogTests.testDefaultTableProperties
doesn't pass without RESTSessionCatalog
change. Added a new commit to fix it.
core/src/main/java/org/apache/iceberg/view/BaseMetastoreViewCatalog.java
Outdated
Show resolved
Hide resolved
2f6f9fc
to
5a19171
Compare
core/src/test/java/org/apache/iceberg/view/ViewCatalogTests.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/apache/iceberg/view/ViewCatalogTests.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/apache/iceberg/view/ViewCatalogTests.java
Outdated
Show resolved
Hide resolved
4afe084
to
7911403
Compare
7911403
to
178a06f
Compare
178a06f
to
eb8b60b
Compare
Fixes #10822