Skip to content
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

Support smallint, tinyint, date type of Cassandra #141

Merged
merged 2 commits into from Feb 26, 2019

Conversation

ebyhr
Copy link
Member

@ebyhr ebyhr commented Feb 2, 2019

Continuation of prestodb/presto#7123

@cla-bot cla-bot bot added the cla-signed label Feb 2, 2019
Copy link
Member

@findepi findepi left a comment

Choose a reason for hiding this comment

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

Overall looks good, thank you for your contribution!
Bunch of comments.

@@ -76,6 +84,10 @@ public CassandraPageSink(
this.columnTypes = ImmutableList.copyOf(requireNonNull(columnTypes, "columnTypes is null"));
this.generateUUID = generateUUID;

toCassandraDate = protocolVersion.toInt() <= ProtocolVersion.V3.toInt() ?
Copy link
Member

Choose a reason for hiding this comment

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

do we have coverage for both protocols?

Copy link
Member Author

Choose a reason for hiding this comment

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

As cassandra.protocol-version in cassandra.rst, it says we can use V2, V3 and V4. Current upstream's test coverage is only V3 though.

@ebyhr
Copy link
Member Author

ebyhr commented Feb 20, 2019

Update variable name in CassandraType.java.

Copy link
Member

@findepi findepi left a comment

Choose a reason for hiding this comment

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

LGTM, minor comments.
Please apply changes inline (no fixup commits), but please do not rebase.

@@ -70,6 +71,7 @@
private final CassandraSession cassandraSession;
private final CassandraPartitionManager partitionManager;
private final boolean allowDropTable;
private final ProtocolVersion protocolVersion;
Copy link
Member

Choose a reason for hiding this comment

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

cmt msg "Support smallint, tinyint, date type of Cassandra"

change to

Support Cassandra smallint, tinyint and date types

@@ -85,6 +87,7 @@ public CassandraMetadata(
this.partitionManager = requireNonNull(partitionManager, "partitionManager is null");
this.cassandraSession = requireNonNull(cassandraSession, "cassandraSession is null");
this.allowDropTable = requireNonNull(config, "config is null").getAllowDropTable();
this.protocolVersion = requireNonNull(config, "config is null").getProtocolVersion();
Copy link
Member

Choose a reason for hiding this comment

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

Annotate io.prestosql.plugin.cassandra.CassandraClientConfig#getProtocolVersion with @NotNull.

@ebyhr
Copy link
Member Author

ebyhr commented Feb 23, 2019

Please apply changes inline (no fixup commits), but please do not rebase.

@findepi Sorry, what do you mean...?

@findepi
Copy link
Member

findepi commented Feb 25, 2019

(discussed offline)

@ebyhr
Copy link
Member Author

ebyhr commented Feb 25, 2019

Rebased to resolve conflicts, therefore force-pushed shows large diff.

@findepi
Copy link
Member

findepi commented Feb 25, 2019

@ebyhr thanks!
Looks good. Can you squash (fixup) Minor fixes into Support Cassandra smallint, tinyint and date types ?
Then I will merge when build is green.

@ebyhr
Copy link
Member Author

ebyhr commented Feb 26, 2019

Squashed and the build is green.

@findepi findepi merged commit 5d053b1 into trinodb:master Feb 26, 2019
@findepi
Copy link
Member

findepi commented Feb 26, 2019

Merged, thanks!

@findepi findepi added this to the 304 milestone Feb 26, 2019
@findepi findepi mentioned this pull request Feb 26, 2019
6 tasks
v-jizhang added a commit to v-jizhang/presto that referenced this pull request May 24, 2021
Cherry-pick of trinodb/trino#141. This is
also a fix for prestodb#15147 which
tried to backport Trino prestodb#141 but that backporting was incomplete
and caused the Cassandra tests to fail.

Resolves: prestodb#15749

Co-authored-by: Yuya Ebihara <ebyhry@gmail.com>
highker pushed a commit to prestodb/presto that referenced this pull request May 25, 2021
Cherry-pick of trinodb/trino#141. This is
also a fix for #15147 which
tried to backport Trino #141 but that backporting was incomplete
and caused the Cassandra tests to fail.

Resolves: #15749

Co-authored-by: Yuya Ebihara <ebyhry@gmail.com>
@ebyhr ebyhr deleted the support-smallint-tinyint branch September 5, 2021 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants