Skip to content

Commit

Permalink
[CALCITE-4301] Unit test 'testCollectionsInnerValues()' for Cassandra…
Browse files Browse the repository at this point in the history
… adapter is wrong (Alessandro Solimando)

Tested with guava.version 25.0-jre

Close apache#2199
  • Loading branch information
asolimando authored and zabetak committed Oct 9, 2020
1 parent e328a33 commit 5ae3c16
Showing 1 changed file with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.cassandraunit.CQLDataLoader;
import org.cassandraunit.dataset.cql.ClassPathCQLDataSet;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.parallel.Execution;
Expand Down Expand Up @@ -176,33 +175,31 @@ static void load(Session session) {
.with(DTCASSANDRA)
.query("select \"f_list\"[1], "
+ "\"f_map\"['k1'], "
+ "\"f_tuple\"['1'], "
+ "\"f_tuple\"['2'], "
+ "\"f_tuple\"['3']"
+ "\"test_collections\".\"f_tuple\".\"1\", "
+ "\"test_collections\".\"f_tuple\".\"2\", "
+ "\"test_collections\".\"f_tuple\".\"3\""
+ " from \"test_collections\"")
.typeIs("[EXPR$0 INTEGER"
+ ", EXPR$1 VARCHAR"
+ ", EXPR$2 BIGINT"
+ ", EXPR$3 VARBINARY"
+ ", EXPR$4 TIMESTAMP]");
+ ", 1 BIGINT"
+ ", 2 VARBINARY"
+ ", 3 TIMESTAMP]");
}

// ignored as tuple elements returns 'null' when accessed in the select statement
@Disabled
@Test void testCollectionsInnerValues() {
CalciteAssert.that()
.with(DTCASSANDRA)
.query("select \"f_list\"[1], "
+ "\"f_map\"['k1'], "
+ "\"f_tuple\"['1'], "
+ "\"f_tuple\"['2'], "
+ "\"f_tuple\"['3']"
+ "\"test_collections\".\"f_tuple\".\"1\", "
+ "\"test_collections\".\"f_tuple\".\"2\", "
+ "\"test_collections\".\"f_tuple\".\"3\""
+ " from \"test_collections\"")
.returns("EXPR$0=1"
+ "; EXPR$1=v1"
+ "; EXPR$2=3000000000"
+ "; EXPR$3=30ff87"
+ "; EXPR$4=2015-05-03 13:30:54.234");
+ "; 1=3000000000"
+ "; 2=30ff87"
+ "; 3=2015-05-03 11:30:54\n");
}

// frozen collections should not affect the row type
Expand Down

0 comments on commit 5ae3c16

Please sign in to comment.