Treat precision as NANOSECONDS for timestamp to be coerced #18003
Conversation
0c657ad to
b941d64
Compare
There was a problem hiding this comment.
I am a little bit missed, why it's safe to remove it here?
It's because of this change in HivePageSource:
if (fromType instanceof TimestampType timestampType && toType instanceof VarcharType varcharType) {
// --deleted-- if (timestampType.isShort()) {
// --deleted-- return Optional.of(new ShortTimestampToVarcharCoercer(timestampType, varcharType));
// }
return Optional.of(new LongTimestampToVarcharCoercer(timestampType, varcharType));
}
There was a problem hiding this comment.
Previously we were respecting the timestamp precision - so we need a coercer which would could have timestamp read as long or it could be as LongTimestamp - but this change would ensure that we would be reading the timestamp column as a NANOSECOND - so we don't need ShortTimestampToVarcharCoercer
b941d64 to
e520eb3
Compare
plugin/trino-hive/src/main/java/io/trino/plugin/hive/coercions/CoercionUtils.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/coercions/CoercionUtils.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/coercions/CoercionUtils.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/coercions/CoercionUtils.java
Outdated
Show resolved
Hide resolved
e520eb3 to
c34eeea
Compare
|
@krvikash Thanks for the review. Addressed the comments |
eb18007 to
6be4816
Compare
6be4816 to
a2cf304
Compare
|
squashed to make reviewable |
|
skimmed. looks directionally correct |
656b77a to
d3bd7e2
Compare
There was a problem hiding this comment.
Just a question: We are no longer relay on a session?
There was a problem hiding this comment.
Previously we rely on the session to determine the timestamp precision so that we could read the timestamp column with that precision and now we would read them as NANOSECOND irrespective of the precision configured.
plugin/trino-hive/src/main/java/io/trino/plugin/hive/coercions/CoercionUtils.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/coercions/CoercionUtils.java
Outdated
Show resolved
Hide resolved
This will be irrespective of the precision configured or specified as session property.
d3bd7e2 to
e864bce
Compare
|
@krvikash AC |
Description
This will be irrespective of the precision configured or specified as
session property.
Additional context and related issues
Depends on #17900.
Release notes
( ) This is not user-visible or docs only and no release notes are required.
(x) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text: