Skip to content

Commit 1fb914c

Browse files
committed
Enable and fix all Cassandra connector tests in CI
1 parent 0494998 commit 1fb914c

File tree

6 files changed

+253
-155
lines changed

6 files changed

+253
-155
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- ":presto-tests -P ci-only-plan-determinism"
4949
- ":presto-tests -P ci-only-resource-manager"
5050
- ":presto-accumulo"
51-
- ":presto-cassandra -P test-cassandra-integration-smoke-test"
51+
- ":presto-cassandra -P ci-full-tests"
5252
- ":presto-hive"
5353
- ":presto-hive -P test-hive-materialized-queries"
5454
- ":presto-hive -P test-hive-materialized-aggregations"

presto-cassandra/pom.xml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,18 +272,14 @@
272272
</plugins>
273273
</build>
274274
</profile>
275+
<!-- Full test suite for CI/CD pipelines -->
275276
<profile>
276-
<id>test-cassandra-integration-smoke-test</id>
277+
<id>ci-full-tests</id>
277278
<build>
278279
<plugins>
279280
<plugin>
280281
<groupId>org.apache.maven.plugins</groupId>
281282
<artifactId>maven-surefire-plugin</artifactId>
282-
<configuration>
283-
<includes>
284-
<include>**/TestCassandraIntegrationSmokeTest.java</include>
285-
</includes>
286-
</configuration>
287283
</plugin>
288284
</plugins>
289285
</build>

presto-cassandra/src/test/java/com/facebook/presto/cassandra/TestCassandraDistributed.java

Lines changed: 64 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.testng.annotations.AfterClass;
2020
import org.testng.annotations.Optional;
2121

22+
import static com.facebook.presto.common.type.BigintType.BIGINT;
2223
import static com.facebook.presto.common.type.VarcharType.VARCHAR;
2324
import static com.facebook.presto.testing.MaterializedResult.resultBuilder;
2425
import static com.facebook.presto.testing.assertions.Assert.assertEquals;
@@ -119,16 +120,16 @@ public void testShowColumns(@Optional("PARQUET") String storageFormat)
119120
{
120121
MaterializedResult actual = computeActual("SHOW COLUMNS FROM orders");
121122

122-
MaterializedResult expectedParametrizedVarchar = resultBuilder(getSession(), VARCHAR, VARCHAR, VARCHAR, VARCHAR)
123-
.row("orderkey", "bigint", "", "")
124-
.row("custkey", "bigint", "", "")
125-
.row("orderstatus", "varchar", "", "")
126-
.row("totalprice", "double", "", "")
127-
.row("orderdate", "varchar", "", "")
128-
.row("orderpriority", "varchar", "", "")
129-
.row("clerk", "varchar", "", "")
130-
.row("shippriority", "integer", "", "")
131-
.row("comment", "varchar", "", "")
123+
MaterializedResult expectedParametrizedVarchar = resultBuilder(getSession(), VARCHAR, VARCHAR, VARCHAR, VARCHAR, BIGINT, BIGINT, BIGINT)
124+
.row("orderkey", "bigint", "", "", Long.valueOf(19), null, null)
125+
.row("custkey", "bigint", "", "", Long.valueOf(19), null, null)
126+
.row("orderstatus", "varchar", "", "", null, null, Long.valueOf(2147483647))
127+
.row("totalprice", "double", "", "", Long.valueOf(53), null, null)
128+
.row("orderdate", "varchar", "", "", null, null, Long.valueOf(2147483647))
129+
.row("orderpriority", "varchar", "", "", null, null, Long.valueOf(2147483647))
130+
.row("clerk", "varchar", "", "", null, null, Long.valueOf(2147483647))
131+
.row("shippriority", "integer", "", "", Long.valueOf(10), null, null)
132+
.row("comment", "varchar", "", "", null, null, Long.valueOf(2147483647))
132133
.build();
133134

134135
assertEquals(actual, expectedParametrizedVarchar);
@@ -151,4 +152,57 @@ public void testWrittenStats()
151152
{
152153
// TODO Cassandra connector supports CTAS and inserts, but the test would fail
153154
}
155+
156+
@Override
157+
public void testPayloadJoinApplicability()
158+
{
159+
// no op -- test not supported due to lack of support for array types.
160+
}
161+
162+
@Override
163+
public void testPayloadJoinCorrectness()
164+
{
165+
// no op -- test not supported due to lack of support for array types.
166+
}
167+
@Override
168+
public void testNonAutoCommitTransactionWithCommit()
169+
{
170+
// Connector only supports writes using ctas
171+
}
172+
173+
@Override
174+
public void testNonAutoCommitTransactionWithRollback()
175+
{
176+
// Connector only supports writes using ctas
177+
}
178+
179+
@Override
180+
public void testRemoveRedundantCastToVarcharInJoinClause()
181+
{
182+
// no op -- test not supported due to lack of support for array types.
183+
}
184+
185+
@Override
186+
public void testStringFilters()
187+
{
188+
// no op -- test not supported due to lack of support for char type.
189+
}
190+
191+
@Override
192+
public void testSubfieldAccessControl()
193+
{
194+
// no op -- test not supported due to lack of support for array types.
195+
}
196+
197+
@Override
198+
protected String getOrderDateExpression(String storageFormat)
199+
{
200+
return "CAST(o.orderdate AS DATE)";
201+
}
202+
203+
@Override
204+
protected String getShipDateExpression(String storageFormat)
205+
{
206+
return "cast(l.shipdate as DATE)";
207+
}
154208
}

0 commit comments

Comments
 (0)