-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Add query table function for query pass-through to Cassandra connector
#15973
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
Conversation
094257d to
9a6a0d4
Compare
plugin/trino-cassandra/src/main/java/io/trino/plugin/cassandra/CassandraSplitManager.java
Outdated
Show resolved
Hide resolved
plugin/trino-cassandra/src/main/java/io/trino/plugin/cassandra/CassandraTableHandle.java
Outdated
Show resolved
Hide resolved
plugin/trino-cassandra/src/main/java/io/trino/plugin/cassandra/CassandraTableHandle.java
Outdated
Show resolved
Hide resolved
plugin/trino-cassandra/src/main/java/io/trino/plugin/cassandra/CassandraTableHandle.java
Outdated
Show resolved
Hide resolved
plugin/trino-cassandra/src/main/java/io/trino/plugin/cassandra/CassandraMetadata.java
Outdated
Show resolved
Hide resolved
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.
As a follow up - can we use assertJsonRoundTrip for testing these handles ?
plugin/trino-cassandra/src/test/java/io/trino/plugin/cassandra/TestCassandraConnectorTest.java
Outdated
Show resolved
Hide resolved
|
Addressed comments. |
650d3aa to
176e091
Compare
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.
no changes requested : Maybe as a followup - can we inline the method - we could do the cast operation in method which invokes this one.
plugin/trino-cassandra/src/main/java/io/trino/plugin/cassandra/ptf/Query.java
Outdated
Show resolved
Hide resolved
plugin/trino-cassandra/src/main/java/io/trino/plugin/cassandra/ptf/Query.java
Outdated
Show resolved
Hide resolved
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.
Can we use testTable so we don't have to have a dedicated query executor for cassandra and we don't have to drop the table.
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.
Note that TestCassandraTable doesn't support single column with primary key. Using onCassandra is simpler than TestCassandraTable style.
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.
In this case can we move dropping operations to finally block ?
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.
Since we use onCassandra at a some places - Can we add support for TestCassandraTable with a single column primary key ?
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.
Let me handle in follow-up PR.
plugin/trino-cassandra/src/test/java/io/trino/plugin/cassandra/TestCassandraConnectorTest.java
Outdated
Show resolved
Hide resolved
plugin/trino-cassandra/src/main/java/io/trino/plugin/cassandra/CassandraTableHandle.java
Outdated
Show resolved
Hide resolved
plugin/trino-cassandra/src/main/java/io/trino/plugin/cassandra/CassandraSplitManager.java
Outdated
Show resolved
Hide resolved
plugin/trino-cassandra/src/main/java/io/trino/plugin/cassandra/CassandraSplitManager.java
Outdated
Show resolved
Hide resolved
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.
What is your opinion on returning as CassandraNamedRelationHandle ?
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 elaborate on that?
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.
Currently CassandraTable has two fields - CassandraTableHandle and List<CassandraColumnHandle. CassandraTableHandle is wrapper for both named and query based relation - which might be an overkill here. Instead can we have something like this
public CassandraTable(CassandraNamedRelationHandle tableHandle, List<CassandraColumnHandle> columns)
Just thinking out aloud.
plugin/trino-cassandra/src/main/java/io/trino/plugin/cassandra/CassandraRecordCursor.java
Outdated
Show resolved
Hide resolved
176e091 to
45cb706
Compare
|
Addressed comments. |
|
I found a correctness issue when duplicated columns exist with different cases. e.g. col & COL. I'm fixing the issue now. |
This is needed for upcoming query pass-through function.
45cb706 to
38fb388
Compare
Praveen2112
left a 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.
LGTM. Minor comments. Thanks for working on this.
plugin/trino-cassandra/src/main/java/io/trino/plugin/cassandra/CassandraMetadata.java
Outdated
Show resolved
Hide resolved
plugin/trino-cassandra/src/main/java/io/trino/plugin/cassandra/CassandraMetadata.java
Outdated
Show resolved
Hide resolved
plugin/trino-cassandra/src/main/java/io/trino/plugin/cassandra/CassandraMetadata.java
Outdated
Show resolved
Hide resolved
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.
Currently CassandraTable has two fields - CassandraTableHandle and List<CassandraColumnHandle. CassandraTableHandle is wrapper for both named and query based relation - which might be an overkill here. Instead can we have something like this
public CassandraTable(CassandraNamedRelationHandle tableHandle, List<CassandraColumnHandle> columns)
Just thinking out aloud.
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.
In this case can we move dropping operations to finally block ?
plugin/trino-cassandra/src/test/java/io/trino/plugin/cassandra/TestCassandraConnectorTest.java
Outdated
Show resolved
Hide resolved
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.
Since we use onCassandra at a some places - Can we add support for TestCassandraTable with a single column primary key ?
plugin/trino-cassandra/src/test/java/io/trino/plugin/cassandra/TestCassandraConnectorTest.java
Outdated
Show resolved
Hide resolved
38fb388 to
f825e49
Compare
Description
Add
querytable function for query pass-through to Cassandra connectorRelease notes
(x) Release notes are required, with the following suggested text: