-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Variable precision timestamp support for Hive write operations #5283
Conversation
403b98a
to
a05eb58
Compare
a05eb58
to
83da853
Compare
The data gets written with abundant precision
but then:
|
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.
initial feedback
presto-hive/src/main/java/io/prestosql/plugin/hive/HiveMetadata.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/HiveMetadata.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/util/FieldSetterFactory.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/util/FieldSetterFactory.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/util/FieldSetterFactory.java
Outdated
Show resolved
Hide resolved
presto-hive/src/test/java/io/prestosql/plugin/hive/TestHiveFileFormats.java
Outdated
Show resolved
Hide resolved
presto-hive/src/test/java/io/prestosql/plugin/hive/TestHiveIntegrationSmokeTest.java
Outdated
Show resolved
Hide resolved
presto-product-tests/src/main/java/io/prestosql/tests/hive/TestHiveStorageFormats.java
Outdated
Show resolved
Hide resolved
presto-rcfile/src/main/java/io/prestosql/rcfile/TimestampUtils.java
Outdated
Show resolved
Hide resolved
presto-rcfile/src/main/java/io/prestosql/rcfile/TimestampUtils.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/util/FieldSetterFactory.java
Outdated
Show resolved
Hide resolved
83da853
to
a05fb8b
Compare
presto-main/src/main/java/io/prestosql/testing/MaterializedResult.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/testing/MaterializedResult.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/util/FieldSetterFactory.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/util/FieldSetterFactory.java
Outdated
Show resolved
Hide resolved
presto-hive/src/test/java/io/prestosql/plugin/hive/TestHiveFileFormats.java
Outdated
Show resolved
Hide resolved
presto-plugin-toolkit/src/main/java/io/prestosql/plugin/base/type/TimestampRepresentations.java
Outdated
Show resolved
Hide resolved
presto-plugin-toolkit/src/main/java/io/prestosql/plugin/base/type/TimestampRepresentations.java
Outdated
Show resolved
Hide resolved
presto-product-tests/src/main/java/io/prestosql/tests/hive/TestHiveStorageFormats.java
Outdated
Show resolved
Hide resolved
presto-rcfile/src/main/java/io/prestosql/rcfile/TimestampUtils.java
Outdated
Show resolved
Hide resolved
presto-hive/src/test/java/io/prestosql/plugin/hive/TestHiveFileFormats.java
Outdated
Show resolved
Hide resolved
@dain a question to you -- a05fb8b#r495844291 @electrum a question to you -- a05fb8b#r495843768 (posting here, as this could have been lost in the noise) |
1e2e4dd
to
33e9a6e
Compare
presto-orc/src/main/java/io/prestosql/orc/writer/TimestampColumnWriter.java
Show resolved
Hide resolved
presto-plugin-toolkit/src/main/java/io/prestosql/plugin/base/type/HiveFileTimestamp.java
Outdated
Show resolved
Hide resolved
presto-rcfile/src/main/java/io/prestosql/rcfile/TimestampUtils.java
Outdated
Show resolved
Hide resolved
presto-rcfile/src/main/java/io/prestosql/rcfile/TimestampUtils.java
Outdated
Show resolved
Hide resolved
presto-rcfile/src/main/java/io/prestosql/rcfile/binary/TimestampEncoding.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/util/FieldSetterFactory.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/util/FieldSetterFactory.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.
See comments (mostly minor)
33e9a6e
to
1fc9aa8
Compare
presto-main/src/main/java/io/prestosql/testing/MaterializedResult.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/util/FieldSetterFactory.java
Show resolved
Hide resolved
presto-hive/src/test/java/io/prestosql/plugin/hive/TestHiveIntegrationSmokeTest.java
Show resolved
Hide resolved
presto-hive/src/test/java/io/prestosql/plugin/hive/TestHiveIntegrationSmokeTest.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/testing/MaterializedResult.java
Outdated
Show resolved
Hide resolved
presto-product-tests/src/main/java/io/prestosql/tests/hive/TestHiveStorageFormats.java
Outdated
Show resolved
Hide resolved
presto-rcfile/src/main/java/io/prestosql/rcfile/TimestampUtils.java
Outdated
Show resolved
Hide resolved
8b3b684
to
2b157a5
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.
%
presto-hive/src/main/java/io/prestosql/plugin/hive/HiveMetadata.java
Outdated
Show resolved
Hide resolved
@@ -522,7 +523,7 @@ else if (insertExistingPartitionsBehavior == InsertExistingPartitionsBehavior.ER | |||
} | |||
|
|||
List<Type> types = dataColumns.stream() | |||
.map(column -> column.getHiveType().getType(typeManager)) | |||
.map(column -> column.getHiveType().getType(typeManager, getTimestampPrecision(session).getPrecision())) |
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.
getType(TypeManager)
overload is still used; for example io.prestosql.plugin.hive.HiveMetadata#finishCreateTable
, io.prestosql.plugin.hive.HiveMetadata#finishInsert
call sites look relevant
please make sure there is an issue covering cleanup of the other ones
presto-hive/src/main/java/io/prestosql/plugin/hive/orc/OrcFileWriterFactory.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/util/FieldSetterFactory.java
Outdated
Show resolved
Hide resolved
presto-product-tests/src/main/java/io/prestosql/tests/hive/TestHiveStorageFormats.java
Outdated
Show resolved
Hide resolved
presto-rcfile/src/main/java/io/prestosql/rcfile/TimestampUtils.java
Outdated
Show resolved
Hide resolved
7ddddb3
to
b5106fb
Compare
b5106fb
to
1a5d8a1
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.
A few minor comments. @dain should look at the potential RCBinary writer regression
presto-hive/src/main/java/io/prestosql/plugin/hive/HiveMetadata.java
Outdated
Show resolved
Hide resolved
presto-rcfile/src/main/java/io/prestosql/rcfile/TimestampUtils.java
Outdated
Show resolved
Hide resolved
presto-hive/src/test/java/io/prestosql/plugin/hive/TestHiveIntegrationSmokeTest.java
Outdated
Show resolved
Hide resolved
presto-hive/src/test/java/io/prestosql/plugin/hive/TestHiveIntegrationSmokeTest.java
Outdated
Show resolved
Hide resolved
b2158ed
to
b483624
Compare
b483624
to
26beb0e
Compare
Thanks! |
Write path for timestamps now honors the precision specified in the Hive config (or session). Stats collection is only supported for millisecond precision; when a higher precision is specified, timestamp columns will be ignored for the purpose of collecting stats. The limitation will be addressed when #5170 is implemented.