-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fallback to an available alter table/partitions API in Hive Metastore 3.x #12771
Conversation
This needs a product test with Hive 3 (non-HDP). |
...ests/src/main/java/io/trino/tests/product/hive/TestWriteToHiveTransactionalTableInTrino.java
Show resolved
Hide resolved
...rino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/MockThriftMetastoreClient.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftHiveMetastore.java
Outdated
Show resolved
Hide resolved
@findepi my understanding is the |
170d64b
to
3b6b4ce
Compare
...roduct-tests-launcher/src/main/java/io/trino/tests/product/launcher/suite/suites/Suite1.java
Outdated
Show resolved
Hide resolved
3b6b4ce
to
c0b9527
Compare
...roduct-tests-launcher/src/main/java/io/trino/tests/product/launcher/suite/suites/Suite1.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftHiveMetastore.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftHiveMetastore.java
Outdated
Show resolved
Hide resolved
return null; | ||
}, | ||
client -> { | ||
client.alterTableWithEnvironmentContext(table.getDbName(), table.getTableName(), table, new EnvironmentContext()); |
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.
why no transactionId
and writeId
being passed here here?
this is called from updateTableWriteId
method, so seems like writeId
is the reason why we are calling HMS.
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 the reason that there is no writeId passed explicitly here is that there is a writeId in the Table
object. I verified that is true by looking at the generated Thrift code.
9fadc75
to
91cb4f8
Compare
@findepi apologies for not keeping on top of this PR. I've resolved conflicts and applied all feedback so its ready for another review whenever you get a chance. Thanks! |
...rino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftHiveMetastoreClient.java
Show resolved
Hide resolved
...ests/src/main/java/io/trino/tests/product/hive/TestWriteToHiveTransactionalTableInTrino.java
Outdated
Show resolved
Hide resolved
91cb4f8
to
783c564
Compare
10c8c78
to
5a52a0f
Compare
@posulliv Can you please squash the commits so that PTs and test are in same commit |
Can we restrict the commit message length to around 70 |
Hive Metastore 3.1.2 doesn't have the new alter_table_req and alter_partitions_req API. This commit adds the ability to fallback to alter_table_with_environment_context and alter_partitions_with_environment_context in case the new APIs are not available. Co-authored-by: Abhishek Khanna <[email protected]>
5a52a0f
to
9184619
Compare
@Praveen2112 no problem. Squashed into a single commit and restricted line length for commit message to about 70 characters. |
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 ok to me. If it works with the 3.1-series, as shown by the tests, it should be ok.
Description
HiveMetaStore 3.1.2 doesn't have the
alter_table_req
andalter_partitions_req
API requests. This PR adds the ability to fallback toalter_table_with_environment_context
andalter_partitions_with_environment_context
in case those APIs are not available.This PR takes the commit from an old open PR (#6180) and updates it for Trino and adds a product test.
I added a new product test as I could not get the
testHiveTransactionalTable
product test to work with the Apache Hive 3.1.2 HMS since it requires a whole Hadoop environment. Instead, I created a few simple tests to cover this functionality and added them to theHMS_ONLY
group which uses an Apache Hive 3.1.2 metastore.Fix.
Hive connector.
Related issues, pull requests, and links
Documentation
(X ) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.
Release notes
( ) No release notes entries required.
( ) Release notes entries required with the following suggested text: