-
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
Correct decoding for Trino UUID partition key value #10856
Correct decoding for Trino UUID partition key value #10856
Conversation
" typetimestamp timestamp, " + | ||
" typeansi ascii, " + | ||
" typeboolean boolean, " + | ||
" typedecimal decimal, " + |
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've skipped (in this initial commit) on purpose adding the typedecimal
field to the composed primary key because the test is failing. Apparently in Cassandra 2.2 when comparing 128.0
with 128
there is no match found.
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.
Could you file an issue and leave as code comment?
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 created #10927 and referenced it in the new test.
@@ -237,6 +238,32 @@ public void testCharVarcharComparison() | |||
.hasMessage("unsupported type: char(3)"); | |||
} | |||
|
|||
@Test | |||
public void testAllPartitionKeyTypesPushdownPredicate() |
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.
TestCassandraConnectorTest
tests on Cassandra 2.2
.
However the code has the following logic
for retrieving the partitions.
Any advice on how could we cover the usecase of dealing with Cassandra 2.2+ ?
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.
Not sure if I understood your question correctly, but the image name 2.2
gets the latest 2.2.x
(=2.2.19 today). The comparison (2.2.19 compareTo 2.2 > 0) will return true
.
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.
Sorry for the confusion.
I was wondering how do we get to test the else
branch.
log.debug("Using combination of partition values to fetch partitions.");
rows = queryPartitionKeysLegacyWithMultipleQueries(table, filterPrefixes);
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.
We can get the coverage by running tests on Cassandra 2.1
. It will require some refactoring of tests though.
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.
Please separate into two commits because other types are unrelates to the bug fix
- Correct decoding for Trino UUID partition key value + only UUID test
- Add other types to the test
@@ -237,6 +238,32 @@ public void testCharVarcharComparison() | |||
.hasMessage("unsupported type: char(3)"); | |||
} | |||
|
|||
@Test | |||
public void testAllPartitionKeyTypesPushdownPredicate() |
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.
We can get the coverage by running tests on Cassandra 2.1
. It will require some refactoring of tests though.
3b5a836
to
b73fc77
Compare
Merged, thanks! |
Awesome @findinpath @ebyhr Thanks! |
Fixes #10799