Skip to content

Conversation

@shardulm94
Copy link
Contributor

In #983 (comment) we discovered issues with ORC predicate pushdown for timestamp types, where timestamps less than epoch were not handled correctly.
ed91355 fixes this and updates the test case to test for both pre epoch and post epoch values

After fixing this, I also found that ORC column stats for timestamp are only stored to millisecond precisions (with round down) and hence predicates on timestamp types with sub-millisecond literals can potentially be evaluated incorrectly. This is being fixed in https://issues.apache.org/jira/browse/ORC-611. So for the time being, I have disabled pushdown for timestamp types in 63bc62b

@shardulm94
Copy link
Contributor Author

cc @rdblue @chenjunjiedada

@shardulm94 shardulm94 mentioned this pull request May 26, 2020
(microsFromEpoch % 1_000_000) * 1_000));
return Timestamp.from(Instant.ofEpochSecond(
Math.floorDiv(microsFromEpoch, 1_000_000),
Math.floorMod(microsFromEpoch, 1_000_000) * 1_000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous logic did not correctly handle pre-epoch timestamps and resulted in off by one second error which was the primary cause of failures in #983 (% returns negative values if sign(a)!=sign(b) so it interfered with floorDiv which also has handling for the same). After I fixed this issue, I ran into ORC-611,

@rdblue rdblue merged commit 9583787 into apache:master May 26, 2020
@shardulm94 shardulm94 deleted the orc-ppd-timestamp-fix branch July 15, 2020 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants