-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[Iceberg]Support view on Rest catalog and Nessie catalog #23793
[Iceberg]Support view on Rest catalog and Nessie catalog #23793
Conversation
aa7987a
to
6975145
Compare
else { | ||
columns.add(PATH_COLUMN_METADATA); | ||
columns.add(DATA_SEQUENCE_NUMBER_COLUMN_METADATA); | ||
catch (NoSuchTableException e) { |
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.
Instead of catching this exception, does it make sense to add a new method, isIcebergView
, then just load the view directly if it's true?
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.
Yes, it seems more natural this way. But I did not find an efficient way to implement method isIcebergView
. ViewCatalog
in Iceberg library provide a method boolean viewExists(TableIdentifier identifier)
, based on this method, we can implement isIcebergView
as follows:
boolean isIcebergView(......, SchemaTableName table) {
......
if (catalog instanceof ViewCatalog) {
return ((ViewCatalog) catalog).viewExists(toIcebergTableIdentifier(table));
}
return false;
}
However, when we examine ViewCatalog.viewExists(identifier)
provided by Iceberg library, we find that its implementation is based on loadView(idenfifier)
as well:
boolean viewExists(TableIdentifier identifier) {
try {
loadView(identifier);
return true;
} catch (NoSuchViewException e) {
return false;
}
}
Considering this situation, the above way doesn't seem very efficient, it will do a lot of additional view loading, whether we are querying tables or views.
So the way of capturing exceptions may not seem so natural, but it's an efficient way as far as I can think of. What do you think, which one is more preferable? And open for any other thoughts.
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.
Agreed, thanks for the explanation.
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.
Can you add some of this information as a comment so folks who read this code later will understand 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.
Sure, the comment has been added. Please take a look when available, thanks.
6975145
to
c1c100d
Compare
Thanks for the release note entry! Nit rephrase suggestion to follow the Order of changes in the Release Notes Guideline.
|
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.
Couple nits, otherwise LGTM
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergHiveMetadata.java
Outdated
Show resolved
Hide resolved
3b01308
to
addb7c9
Compare
@steveburnett Thanks for the suggestion, fixed! Please take a look when available. |
LGTM, thanks! |
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.
Some other very small nits, LGTM
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergHiveMetadata.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergNativeMetadata.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergNativeMetadata.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergUtil.java
Outdated
Show resolved
Hide resolved
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 looks great! I know this is a sought-after feature in the community. My only suggestion would be to add a blurb to the Iceberg connector documentation, since right now it only indicates view availability in Hive/Glue
addb7c9
to
092573e
Compare
@kiersten-stokes Thanks for your suggestion, I have supplemented the Iceberg document, please take a look when available. |
Comments has been fixed, please take a look when available, thanks! @tdcmeehan |
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! (docs)
Pull branch, review local doc build. Thanks!
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! Thank you
Noticed a few nits in formatting for the release note entry - tiny, but fixing it now saves time when the next release note PR is done.
|
Fixed, thanks for your suggestion. @steveburnett |
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.
two minor things
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergNativeMetadata.java
Show resolved
Hide resolved
9557bf9
092573e
to
9557bf9
Compare
Hi Zac @ZacBlanco, after recheck the code, I confirm that an iceberg |
I think it is reasonable to not have a cache then |
Description
Iceberg's
RestCatalog
andNessieCatalog
have implementedViewCatalog
interface, that means we can support operations onview
for Iceberg connector configured with these catalogs. This PR refactorIcebergNativeMetadata
, so that catalogs likeREST
andNESSIE
that implements interfaceViewCatalog
can now support operations onview
.Motivation and Context
Support
view
for Iceberg connector on as many catalog types as possibleImpact
Iceberg connector configured with
REST
andNESSIE
catalogs can now support operations onview
Test Plan
Contributor checklist
Release Notes