-
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
Subclass FileHiveMetastore
for Iceberg connector
#24573
Subclass FileHiveMetastore
for Iceberg connector
#24573
Conversation
bd247c7
to
7fd5ce8
Compare
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 initial things:
presto-iceberg/src/main/java/com/facebook/presto/iceberg/hive/FileIcebergHiveMetastore.java
Outdated
Show resolved
Hide resolved
|
||
@Override | ||
protected void validateReplaceTableType(Table originTable, Table newTable) | ||
{} |
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.
do we need this override? From a cursory glance it seems we should still check if a table is a virtual 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.
Yes we need this override. The logic of the code is that, in Hive or other non-Iceberg lake houses, only views can be updated with replaceTable
; but in Iceberg, views and tables all can be updated with replaceTable
. Moreover, Iceberg need this replaceTable
to support its transaction commit.
...-hive-metastore/src/main/java/com/facebook/presto/hive/metastore/file/FileHiveMetastore.java
Show resolved
Hide resolved
...-hive-metastore/src/main/java/com/facebook/presto/hive/metastore/file/FileHiveMetastore.java
Outdated
Show resolved
Hide resolved
@@ -507,78 +506,33 @@ public synchronized MetastoreOperationResult replaceTable(MetastoreContext metas | |||
return EMPTY_RESULT; | |||
} | |||
|
|||
protected void validateReplaceTableType(Table originTable, Table newTable) |
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.
move the protected functions to be below the public ones and in the order of being called
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.
Ditto for the rest
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, I have adjusted the position of fields and methods in the whole class according to your suggestion, please take a look when convenient, thanks.
7fd5ce8
to
d86e7fe
Compare
Description
Currently, Iceberg connector and Hive connector use the same file based HMS code, however, there are some implementation details that differ between them and need to be special handled. This PR create a dedicated subclass of
FileHiveMetastore
for Iceberg connector, and move the Iceberg specific logic fromFileHiveMetastore
into this dedicated subclass. As discussed in here.Motivation and Context
The modifications of Iceberg specific logic on hive catalog will not affect the
FileHiveMetastore
inpresto-hive-common
.Impact
N/A
Test Plan
Contributor checklist
Release Notes