Skip to content

Commit

Permalink
Update to Calcite 1.11.0. (#3825)
Browse files Browse the repository at this point in the history
  • Loading branch information
gianm authored and jon-wei committed Jan 6, 2017
1 parent 2aa8385 commit a4f81a6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 30 deletions.
9 changes: 7 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
4 changes: 4 additions & 0 deletions sql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
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.
Expand Down Expand Up @@ -65,4 +66,10 @@ protected RelOptPlanner createPlanner(

return planner;
}

@Override
protected SqlRexConvertletTable createConvertletTable()
{
return DruidConvertletTable.instance();
}
}
28 changes: 0 additions & 28 deletions sql/src/test/java/io/druid/sql/calcite/CalciteQueryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down Expand Up @@ -588,11 +585,6 @@ public void testSelectStarWithDimFilterAndPaging() throws Exception
@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(),
Expand All @@ -605,11 +597,6 @@ public void testGroupByNothingWithLiterallyFalseFilter() throws Exception
@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(),
Expand Down Expand Up @@ -2002,11 +1989,6 @@ public void testTimeseriesDescending() throws Exception
@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"
Expand Down Expand Up @@ -2053,11 +2035,6 @@ public void testGroupByExtractYear() throws Exception
@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"
Expand Down Expand Up @@ -2272,11 +2249,6 @@ public void testUsingSubqueryAsFilter() throws Exception
@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 ("
Expand Down

0 comments on commit a4f81a6

Please sign in to comment.