Pushdown DATE, TIMESTAMP, and TIMESTAMP_TZ_MILLIS predicates in MongoDB#13517
Closed
harlequin wants to merge 4 commits intotrinodb:masterfrom
Closed
Pushdown DATE, TIMESTAMP, and TIMESTAMP_TZ_MILLIS predicates in MongoDB#13517harlequin wants to merge 4 commits intotrinodb:masterfrom
harlequin wants to merge 4 commits intotrinodb:masterfrom
Conversation
ebyhr
reviewed
Aug 5, 2022
Member
ebyhr
left a comment
There was a problem hiding this comment.
Please squash commits into one. I would recommend preserving commit author when picking up other contributor's commit.
ebyhr
reviewed
Aug 5, 2022
| } | ||
|
|
||
| if (type == DATE) { | ||
| return Optional.of(new Date(TimeUnit.DAYS.toMillis((Long) trinoNativeValue))); |
Member
There was a problem hiding this comment.
I would recommend adding a preparatory commit to use LocalDate for DATE type in other places.
| } | ||
|
|
||
| if (type == TIMESTAMP_MILLIS) { | ||
| return Optional.of(new Date(TimeUnit.MILLISECONDS.convert((Long) trinoNativeValue, TimeUnit.MICROSECONDS))); |
| } | ||
|
|
||
| if (type == TIMESTAMP_TZ_MILLIS) { | ||
| return Optional.of(new Date(unpackMillisUtc((long) trinoNativeValue))); |
| // bigint range, with decimal to bigint simplification | ||
| assertThat(query("SELECT regionkey, nationkey, name FROM nation WHERE nationkey BETWEEN 18.5 AND 19.5")) | ||
| .matches("VALUES (BIGINT '3', BIGINT '19', CAST('ROMANIA' AS varchar(25)))") | ||
| .isNotFullyPushedDown(FilterNode.class); |
Member
There was a problem hiding this comment.
These tests unrelates to date, timestamp, timestamp_tz_millis change. Please separate a commit.
| .addRoundTrip("time", "TIME '23:59:59.9'", createTimeType(3), "TIME '23:59:59.900'") | ||
| .addRoundTrip("time", "TIME '23:59:59.99'", createTimeType(3), "TIME '23:59:59.990'") | ||
| .addRoundTrip("time", "TIME '23:59:59.999'", createTimeType(3), "TIME '23:59:59.999'") | ||
| .addRoundTrip("time", "TIME '23:59:59.9999'", createTimeType(4), "TIME '23:59:59.9999'") |
Member
There was a problem hiding this comment.
Add tests for timestamp and timestamp with time zone types.
| .addRoundTrip("time", "TIME '23:59:59.999'", createTimeType(3), "TIME '23:59:59.999'") | ||
| .addRoundTrip("time", "TIME '23:59:59.9999'", createTimeType(4), "TIME '23:59:59.9999'") | ||
| .addRoundTrip("time", "TIME '23:59:59.99999'", createTimeType(5), "TIME '23:59:59.99999'") | ||
| .addRoundTrip("time", "TIME '23:59:59.999999'", createTimeType(6), "TIME '23:59:59.999999'") |
|
hope to see some progress 🙏 |
Member
|
Superseded by #14413 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves: #5658
Superseeds: #5682, because it seems that the developer is not active in the moment.
This PR takes all changes as in #5682 and implement additional the proposed changes from discussion.