mirror of https://github.com/apache/druid.git
Update to Calcite 1.11.0. (#3825)
This commit is contained in:
parent
2aa8385fc0
commit
a4f81a6471
9
pom.xml
9
pom.xml
|
@ -59,8 +59,8 @@
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<apache.curator.version>2.11.1</apache.curator.version>
|
<apache.curator.version>2.11.1</apache.curator.version>
|
||||||
<avatica.version>1.8.0</avatica.version>
|
<avatica.version>1.9.0</avatica.version>
|
||||||
<calcite.version>1.10.0</calcite.version>
|
<calcite.version>1.11.0</calcite.version>
|
||||||
<guava.version>16.0.1</guava.version>
|
<guava.version>16.0.1</guava.version>
|
||||||
<guice.version>4.1.0</guice.version>
|
<guice.version>4.1.0</guice.version>
|
||||||
<jetty.version>9.2.5.v20141112</jetty.version>
|
<jetty.version>9.2.5.v20141112</jetty.version>
|
||||||
|
@ -262,6 +262,11 @@
|
||||||
<artifactId>calcite-linq4j</artifactId>
|
<artifactId>calcite-linq4j</artifactId>
|
||||||
<version>${calcite.version}</version>
|
<version>${calcite.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.calcite.avatica</groupId>
|
||||||
|
<artifactId>avatica-core</artifactId>
|
||||||
|
<version>${avatica.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.calcite.avatica</groupId>
|
<groupId>org.apache.calcite.avatica</groupId>
|
||||||
<artifactId>avatica-server</artifactId>
|
<artifactId>avatica-server</artifactId>
|
||||||
|
|
|
@ -46,6 +46,10 @@
|
||||||
<groupId>org.apache.calcite</groupId>
|
<groupId>org.apache.calcite</groupId>
|
||||||
<artifactId>calcite-linq4j</artifactId>
|
<artifactId>calcite-linq4j</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.calcite.avatica</groupId>
|
||||||
|
<artifactId>avatica-core</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.calcite.avatica</groupId>
|
<groupId>org.apache.calcite.avatica</groupId>
|
||||||
<artifactId>avatica-server</artifactId>
|
<artifactId>avatica-server</artifactId>
|
||||||
|
|
|
@ -27,6 +27,7 @@ import org.apache.calcite.plan.RelOptRule;
|
||||||
import org.apache.calcite.plan.volcano.VolcanoPlanner;
|
import org.apache.calcite.plan.volcano.VolcanoPlanner;
|
||||||
import org.apache.calcite.prepare.CalcitePrepareImpl;
|
import org.apache.calcite.prepare.CalcitePrepareImpl;
|
||||||
import org.apache.calcite.rel.RelCollationTraitDef;
|
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.
|
* 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;
|
return planner;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SqlRexConvertletTable createConvertletTable()
|
||||||
|
{
|
||||||
|
return DruidConvertletTable.instance();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,9 +106,6 @@ public class CalciteQueryTest
|
||||||
{
|
{
|
||||||
private static final Logger log = new Logger(CalciteQueryTest.class);
|
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_DEFAULT = new PlannerConfig();
|
||||||
private static final PlannerConfig PLANNER_CONFIG_NO_TOPN = new PlannerConfig()
|
private static final PlannerConfig PLANNER_CONFIG_NO_TOPN = new PlannerConfig()
|
||||||
{
|
{
|
||||||
|
@ -588,11 +585,6 @@ public class CalciteQueryTest
|
||||||
@Test
|
@Test
|
||||||
public void testGroupByNothingWithLiterallyFalseFilter() throws Exception
|
public void testGroupByNothingWithLiterallyFalseFilter() throws Exception
|
||||||
{
|
{
|
||||||
if (!CALCITE_1_11_0) {
|
|
||||||
// https://issues.apache.org/jira/browse/CALCITE-1488
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
testQuery(
|
testQuery(
|
||||||
"SELECT COUNT(*), MAX(cnt) FROM druid.foo WHERE 1 = 0",
|
"SELECT COUNT(*), MAX(cnt) FROM druid.foo WHERE 1 = 0",
|
||||||
ImmutableList.<Query>of(),
|
ImmutableList.<Query>of(),
|
||||||
|
@ -605,11 +597,6 @@ public class CalciteQueryTest
|
||||||
@Test
|
@Test
|
||||||
public void testGroupByOneColumnWithLiterallyFalseFilter() throws Exception
|
public void testGroupByOneColumnWithLiterallyFalseFilter() throws Exception
|
||||||
{
|
{
|
||||||
if (!CALCITE_1_11_0) {
|
|
||||||
// https://issues.apache.org/jira/browse/CALCITE-1488
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
testQuery(
|
testQuery(
|
||||||
"SELECT COUNT(*), MAX(cnt) FROM druid.foo WHERE 1 = 0 GROUP BY dim1",
|
"SELECT COUNT(*), MAX(cnt) FROM druid.foo WHERE 1 = 0 GROUP BY dim1",
|
||||||
ImmutableList.<Query>of(),
|
ImmutableList.<Query>of(),
|
||||||
|
@ -2002,11 +1989,6 @@ public class CalciteQueryTest
|
||||||
@Test
|
@Test
|
||||||
public void testGroupByExtractYear() throws Exception
|
public void testGroupByExtractYear() throws Exception
|
||||||
{
|
{
|
||||||
if (!CALCITE_1_11_0) {
|
|
||||||
// https://issues.apache.org/jira/browse/CALCITE-1509
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
testQuery(
|
testQuery(
|
||||||
"SELECT\n"
|
"SELECT\n"
|
||||||
+ " EXTRACT(YEAR FROM __time) AS \"year\",\n"
|
+ " EXTRACT(YEAR FROM __time) AS \"year\",\n"
|
||||||
|
@ -2053,11 +2035,6 @@ public class CalciteQueryTest
|
||||||
@Test
|
@Test
|
||||||
public void testExtractFloorTime() throws Exception
|
public void testExtractFloorTime() throws Exception
|
||||||
{
|
{
|
||||||
if (!CALCITE_1_11_0) {
|
|
||||||
// https://issues.apache.org/jira/browse/CALCITE-1509
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
testQuery(
|
testQuery(
|
||||||
"SELECT\n"
|
"SELECT\n"
|
||||||
+ "EXTRACT(YEAR FROM FLOOR(__time TO YEAR)) AS \"year\", SUM(cnt)\n"
|
+ "EXTRACT(YEAR FROM FLOOR(__time TO YEAR)) AS \"year\", SUM(cnt)\n"
|
||||||
|
@ -2272,11 +2249,6 @@ public class CalciteQueryTest
|
||||||
@Test
|
@Test
|
||||||
public void testUsingSubqueryAsFilterOnTwoColumns() throws Exception
|
public void testUsingSubqueryAsFilterOnTwoColumns() throws Exception
|
||||||
{
|
{
|
||||||
if (!CALCITE_1_11_0) {
|
|
||||||
// https://issues.apache.org/jira/browse/CALCITE-1479
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
testQuery(
|
testQuery(
|
||||||
"SELECT __time, cnt, dim1, dim2 FROM druid.foo "
|
"SELECT __time, cnt, dim1, dim2 FROM druid.foo "
|
||||||
+ " WHERE (dim1, dim2) IN ("
|
+ " WHERE (dim1, dim2) IN ("
|
||||||
|
|
Loading…
Reference in New Issue