Update to Calcite 1.11.0. (#3825)

This commit is contained in:
Gian Merlino 2017-01-06 14:45:17 -08:00 committed by Jonathan Wei
parent 2aa8385fc0
commit a4f81a6471
4 changed files with 18 additions and 30 deletions

View File

@ -59,8 +59,8 @@
<properties>
<apache.curator.version>2.11.1</apache.curator.version>
<avatica.version>1.8.0</avatica.version>
<calcite.version>1.10.0</calcite.version>
<avatica.version>1.9.0</avatica.version>
<calcite.version>1.11.0</calcite.version>
<guava.version>16.0.1</guava.version>
<guice.version>4.1.0</guice.version>
<jetty.version>9.2.5.v20141112</jetty.version>
@ -262,6 +262,11 @@
<artifactId>calcite-linq4j</artifactId>
<version>${calcite.version}</version>
</dependency>
<dependency>
<groupId>org.apache.calcite.avatica</groupId>
<artifactId>avatica-core</artifactId>
<version>${avatica.version}</version>
</dependency>
<dependency>
<groupId>org.apache.calcite.avatica</groupId>
<artifactId>avatica-server</artifactId>

View File

@ -46,6 +46,10 @@
<groupId>org.apache.calcite</groupId>
<artifactId>calcite-linq4j</artifactId>
</dependency>
<dependency>
<groupId>org.apache.calcite.avatica</groupId>
<artifactId>avatica-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.calcite.avatica</groupId>
<artifactId>avatica-server</artifactId>

View File

@ -27,6 +27,7 @@ import org.apache.calcite.plan.RelOptRule;
import org.apache.calcite.plan.volcano.VolcanoPlanner;
import org.apache.calcite.prepare.CalcitePrepareImpl;
import org.apache.calcite.rel.RelCollationTraitDef;
import org.apache.calcite.sql2rel.SqlRexConvertletTable;
/**
* Our very own subclass of CalcitePrepareImpl, used to alter behaviors of the JDBC driver as necessary.
@ -65,4 +66,10 @@ public class DruidPlannerImpl extends CalcitePrepareImpl
return planner;
}
@Override
protected SqlRexConvertletTable createConvertletTable()
{
return DruidConvertletTable.instance();
}
}

View File

@ -106,9 +106,6 @@ public class CalciteQueryTest
{
private static final Logger log = new Logger(CalciteQueryTest.class);
// Used to mark tests that should pass once Calcite 1.11.0 is released.
private static final boolean CALCITE_1_11_0 = false;
private static final PlannerConfig PLANNER_CONFIG_DEFAULT = new PlannerConfig();
private static final PlannerConfig PLANNER_CONFIG_NO_TOPN = new PlannerConfig()
{
@ -588,11 +585,6 @@ public class CalciteQueryTest
@Test
public void testGroupByNothingWithLiterallyFalseFilter() throws Exception
{
if (!CALCITE_1_11_0) {
// https://issues.apache.org/jira/browse/CALCITE-1488
return;
}
testQuery(
"SELECT COUNT(*), MAX(cnt) FROM druid.foo WHERE 1 = 0",
ImmutableList.<Query>of(),
@ -605,11 +597,6 @@ public class CalciteQueryTest
@Test
public void testGroupByOneColumnWithLiterallyFalseFilter() throws Exception
{
if (!CALCITE_1_11_0) {
// https://issues.apache.org/jira/browse/CALCITE-1488
return;
}
testQuery(
"SELECT COUNT(*), MAX(cnt) FROM druid.foo WHERE 1 = 0 GROUP BY dim1",
ImmutableList.<Query>of(),
@ -2002,11 +1989,6 @@ public class CalciteQueryTest
@Test
public void testGroupByExtractYear() throws Exception
{
if (!CALCITE_1_11_0) {
// https://issues.apache.org/jira/browse/CALCITE-1509
return;
}
testQuery(
"SELECT\n"
+ " EXTRACT(YEAR FROM __time) AS \"year\",\n"
@ -2053,11 +2035,6 @@ public class CalciteQueryTest
@Test
public void testExtractFloorTime() throws Exception
{
if (!CALCITE_1_11_0) {
// https://issues.apache.org/jira/browse/CALCITE-1509
return;
}
testQuery(
"SELECT\n"
+ "EXTRACT(YEAR FROM FLOOR(__time TO YEAR)) AS \"year\", SUM(cnt)\n"
@ -2272,11 +2249,6 @@ public class CalciteQueryTest
@Test
public void testUsingSubqueryAsFilterOnTwoColumns() throws Exception
{
if (!CALCITE_1_11_0) {
// https://issues.apache.org/jira/browse/CALCITE-1479
return;
}
testQuery(
"SELECT __time, cnt, dim1, dim2 FROM druid.foo "
+ " WHERE (dim1, dim2) IN ("