Skip to content

Commit

Permalink
Upgrade minimum required Cassandra version to 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
krvikash committed Oct 21, 2022
1 parent 0c815b1 commit 52d507d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/src/main/sphinx/connector/cassandra.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Requirements

To connect to Cassandra, you need:

* Cassandra version 2.2 or higher.
* Cassandra version 3.0 or higher.
* Network access from the Trino coordinator and workers to Cassandra.
Port 9042 is the default port.

Expand Down
1 change: 1 addition & 0 deletions plugin/trino-cassandra/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<properties>
<air.main.basedir>${project.parent.basedir}</air.main.basedir>
<dep.native-protocol.version>1.5.1</dep.native-protocol.version>
<air.test.parallel>instances</air.test.parallel>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ public class CassandraServer
public CassandraServer()
throws Exception
{
this("cassandra:2.2");
this("cassandra:3.0", "cu-cassandra.yaml");
}

public CassandraServer(String imageName)
public CassandraServer(String imageName, String configFileName)
throws Exception
{
this(imageName, ImmutableMap.of(), "/etc/cassandra/cassandra.yaml", "cu-cassandra.yaml");
this(imageName, ImmutableMap.of(), "/etc/cassandra/cassandra.yaml", configFileName);
}

public CassandraServer(String imageName, Map<String, String> environmentVariables, String configPath, String configFileName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,15 +550,6 @@ public void testInsertToTableWithHiddenId()
execute("DROP TABLE test_create_table");
}

@Override
public void testCreateTableWithLongColumnName()
{
// TODO: Find the maximum column name length in Cassandra and enable this test.
assertThatThrownBy(super::testCreateTableWithLongColumnName)
.hasMessageMatching(".* Mutation of .* bytes is too large.*");
throw new SkipException("TODO");
}

@Test
public void testCreateTableAs()
{
Expand Down Expand Up @@ -1326,6 +1317,18 @@ public void testRowLevelDelete()
.hasStackTraceContaining("Delete without primary key or partition key is not supported");
}

@Override
protected OptionalInt maxColumnNameLength()
{
return OptionalInt.of(65535);
}

@Override
protected void verifyColumnNameLengthFailurePermissible(Throwable e)
{
assertThat(e).hasMessageContaining("Attempted serializing to buffer exceeded maximum of 65535 bytes:");
}

@Override
protected OptionalInt maxTableNameLength()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class TestCassandraLatestConnectorSmokeTest
protected QueryRunner createQueryRunner()
throws Exception
{
CassandraServer server = closeAfterClass(new CassandraServer("cassandra:3.11.10"));
CassandraServer server = closeAfterClass(new CassandraServer("cassandra:3.11.10", "cu-cassandra.yaml"));
CassandraSession session = server.getSession();
createTestTables(session, KEYSPACE, Timestamp.from(TIMESTAMP_VALUE.toInstant()));
return createCassandraQueryRunner(server, ImmutableMap.of(), ImmutableMap.of(), REQUIRED_TPCH_TABLES);
Expand Down

0 comments on commit 52d507d

Please sign in to comment.