-
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
Read support for Hive's INSERT ONLY ACID tables #1034
Conversation
I quickly skimmed this. Looks fairly straightforward. Thanks a lot for adding this feature. Can you pull out the changes to
|
This is done |
presto-hive/src/main/java/io/prestosql/plugin/hive/BackgroundHiveSplitLoader.java
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/HiveConfig.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.
Just skimming.
In particular, I noticed there will be a bit of naming comments, as certain names do not align with our code style (abbreviations, or spelling of well-known acronyms in names, or spelling of "heartbeat"). I have marked some of them, but I think it could be more effective, if you could take another look at the code and try to update the names. Then the review will be more focused on merits rather than naming.
presto-hive/src/main/java/io/prestosql/plugin/hive/HiveSessionProperties.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/HiveSessionProperties.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/HiveConfig.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/HiveErrorCode.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/HiveSessionProperties.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/HiveWriteUtils.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/HiveACIDState.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.
@@ -0,0 +1,10 @@ | |||
#!/usr/bin/env bash |
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.
When is this environment run?
Anyway, #1239 will make test scaffolding sane here.
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 had to added to scripts, I was running it by hand but I see with your change it will be default. Will wait for #1239 to merge and then remove this env.
bb7398a
to
6cbf287
Compare
9e954de
to
aeb1e90
Compare
@@ -379,13 +389,42 @@ private void invokeNoMoreSplitsIfNecessary() | |||
|
|||
// Bucketed partitions are fully loaded immediately since all files must be loaded to determine the file to bucket mapping | |||
if (tableBucketInfo.isPresent()) { | |||
if (AcidUtils.isTransactionalTable(table.getParameters())) { | |||
throw new PrestoException(NOT_SUPPORTED, "Presto cannot read bucketted hive transactional 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.
This seems to be a serious limitation. For Hive < 3, a transactional table has to be bucketed.
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, this is one of the next items to be picked.
presto-main/src/main/java/io/prestosql/execution/SqlQueryExecution.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/metadata/InsertTableHandle.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/metadata/InsertTableHandle.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/sql/planner/TableHandleExtractor.java
Outdated
Show resolved
Hide resolved
...-hive/src/main/java/io/prestosql/plugin/hive/metastore/thrift/ThriftHiveMetastoreClient.java
Outdated
Show resolved
Hide resolved
...-hive/src/main/java/io/prestosql/plugin/hive/metastore/thrift/ThriftHiveMetastoreClient.java
Outdated
Show resolved
Hide resolved
...-hive/src/main/java/io/prestosql/plugin/hive/metastore/thrift/ThriftHiveMetastoreClient.java
Outdated
Show resolved
Hide resolved
...-hive/src/main/java/io/prestosql/plugin/hive/metastore/thrift/ThriftHiveMetastoreClient.java
Outdated
Show resolved
Hide resolved
presto-spi/src/main/java/io/prestosql/spi/connector/ConnectorTableHandle.java
Outdated
Show resolved
Hide resolved
presto-product-tests/src/main/java/io/prestosql/tests/TestGroups.java
Outdated
Show resolved
Hide resolved
...uct-tests/src/main/java/io/prestosql/tests/hive/acid/TestPartitionedInsertOnlyAcidTable.java
Outdated
Show resolved
Hide resolved
...uct-tests/src/main/java/io/prestosql/tests/hive/acid/TestPartitionedInsertOnlyAcidTable.java
Outdated
Show resolved
Hide resolved
...uct-tests/src/main/java/io/prestosql/tests/hive/acid/TestPartitionedInsertOnlyAcidTable.java
Outdated
Show resolved
Hide resolved
...uct-tests/src/main/java/io/prestosql/tests/hive/acid/TestPartitionedInsertOnlyAcidTable.java
Outdated
Show resolved
Hide resolved
presto-product-tests/conf/tempto/tempto-configuration-for-docker-acid.yaml
Outdated
Show resolved
Hide resolved
...uct-tests/src/main/java/io/prestosql/tests/hive/acid/TestPartitionedInsertOnlyAcidTable.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/thrift/ThriftMetastoreClient.java
Outdated
Show resolved
Hide resolved
aeb1e90
to
094d897
Compare
presto-main/src/main/java/io/prestosql/metadata/InsertTableHandle.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/BackgroundHiveSplitLoader.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/HiveMetastore.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/HiveMetastore.java
Outdated
Show resolved
Hide resolved
presto-spi/src/main/java/io/prestosql/spi/connector/ConnectorTableHandle.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.
I need to do another pass over some parts in more detail, but overall this looks great.
0d1bdcc
to
d76ee37
Compare
...to-product-tests/src/main/java/io/prestosql/tests/hive/acid/TestInsertOnlyAcidTableRead.java
Outdated
Show resolved
Hide resolved
...to-product-tests/src/main/java/io/prestosql/tests/hive/acid/TestInsertOnlyAcidTableRead.java
Outdated
Show resolved
Hide resolved
...to-product-tests/src/main/java/io/prestosql/tests/hive/acid/TestInsertOnlyAcidTableRead.java
Outdated
Show resolved
Hide resolved
...to-product-tests/src/main/java/io/prestosql/tests/hive/acid/TestInsertOnlyAcidTableRead.java
Outdated
Show resolved
Hide resolved
...to-product-tests/src/main/java/io/prestosql/tests/hive/acid/TestInsertOnlyAcidTableRead.java
Outdated
Show resolved
Hide resolved
presto-product-tests/src/main/java/io/prestosql/tests/hive/acid/TestFullAcidTableRead.java
Outdated
Show resolved
Hide resolved
bc80a71
to
e43b261
Compare
Handled your comments @findepi |
0decba8
to
22e5208
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.
I bunch of comments. Overall looks great.
Few outstanding questions.
To make the process more efficient, I made some fixups.
Please double check whcih comments i managed to fixup which i didn't -- and whether you agree with the fixups.
presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/HiveMetastore.java
Show resolved
Hide resolved
...to-hive/src/main/java/io/prestosql/plugin/hive/metastore/SemiTransactionalHiveMetastore.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/metadata/MetadataManager.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/metadata/MetadataManager.java
Outdated
Show resolved
Hide resolved
...-hive/src/main/java/io/prestosql/plugin/hive/metastore/thrift/ThriftHiveMetastoreClient.java
Outdated
Show resolved
Hide resolved
presto-hive/src/test/java/io/prestosql/plugin/hive/AbstractTestHive.java
Outdated
Show resolved
Hide resolved
presto-hive/src/test/java/io/prestosql/plugin/hive/AbstractTestHiveFileSystem.java
Outdated
Show resolved
Hide resolved
...to-product-tests/src/main/java/io/prestosql/tests/hive/acid/TestInsertOnlyAcidTableRead.java
Outdated
Show resolved
Hide resolved
@stagraqubole the PR needs a rebase. Please do the following
thanks for your work on this! |
bd49dba
to
024a743
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.
Let's merge this after the current release goes out.
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 % nits.
Requesting changes or discussion around handling of original files.
I'd prefer to split this out into separate PR.
presto-hive/src/main/java/io/prestosql/plugin/hive/BackgroundHiveSplitLoader.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/BackgroundHiveSplitLoader.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/BackgroundHiveSplitLoader.java
Outdated
Show resolved
Hide resolved
...to-hive/src/main/java/io/prestosql/plugin/hive/metastore/SemiTransactionalHiveMetastore.java
Outdated
Show resolved
Hide resolved
...to-hive/src/main/java/io/prestosql/plugin/hive/metastore/SemiTransactionalHiveMetastore.java
Outdated
Show resolved
Hide resolved
024a743
to
a601f1a
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.
Thanks, please squash.
f314b8f
to
aad26e8
Compare
Merged, thanks! |
testBad() fails on TestHiveInMemoryMetastore with: java.lang.IllegalStateException: Query already begun: Optional[20200306_080241_00002_adgin] while starting query 20200306_080241_00003_adgin at com.google.common.base.Preconditions.checkState(Preconditions.java:823) at io.prestosql.plugin.hive.metastore.SemiTransactionalHiveMetastore.beginQuery(SemiTransactionalHiveMetastore.java:999) at io.prestosql.plugin.hive.HiveMetadata.beginQuery(HiveMetadata.java:2367) at io.prestosql.plugin.hive.AbstractTestHive.testBad(AbstractTestHive.java:954)
Implementation of https://docs.google.com/document/d/1GwSNc_6jSP8N1SyJIHnaMeWvh7JzhGPZ7QKm1DHJqEw
Relates to #576