-
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
Treat precision as NANOSECONDS for timestamp to be coerced #18003
Changes from all commits
fbd03d9
760917f
df2f2eb
ee473c0
e864bce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,7 +90,6 @@ | |
import static io.trino.plugin.hive.HiveSessionProperties.getOrcMaxReadBlockSize; | ||
import static io.trino.plugin.hive.HiveSessionProperties.getOrcStreamBufferSize; | ||
import static io.trino.plugin.hive.HiveSessionProperties.getOrcTinyStripeThreshold; | ||
import static io.trino.plugin.hive.HiveSessionProperties.getTimestampPrecision; | ||
import static io.trino.plugin.hive.HiveSessionProperties.isOrcBloomFiltersEnabled; | ||
import static io.trino.plugin.hive.HiveSessionProperties.isOrcNestedLazy; | ||
import static io.trino.plugin.hive.HiveSessionProperties.isUseOrcColumnNames; | ||
|
@@ -366,7 +365,7 @@ else if (column.getBaseHiveColumnIndex() < fileColumns.size()) { | |
Type readType = column.getType(); | ||
if (orcColumn != null) { | ||
int sourceIndex = fileReadColumns.size(); | ||
Optional<TypeCoercer<?, ?>> coercer = createCoercer(orcColumn.getColumnType(), readType, getTimestampPrecision(session)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a question: We are no longer relay on a session? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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 |
||
Optional<TypeCoercer<?, ?>> coercer = createCoercer(orcColumn.getColumnType(), readType); | ||
if (coercer.isPresent()) { | ||
fileReadTypes.add(coercer.get().getFromType()); | ||
columnAdaptations.add(ColumnAdaptation.coercedColumn(sourceIndex, coercer.get())); | ||
|
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 am a little bit missed, why it's safe to remove it here?
It's because of this change in HivePageSource:
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.
Previously we were respecting the timestamp precision - so we need a coercer which would could have timestamp read as
long
or it could be asLongTimestamp
- but this change would ensure that we would be reading the timestamp column as a NANOSECOND - so we don't needShortTimestampToVarcharCoercer