calcite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jh...@apache.org
Subject calcite git commit: Fix plan changes in Druid tests caused by [CALCITE-1842]
Date Tue, 11 Jul 2017 04:39:57 GMT
Repository: calcite
Updated Branches:
  refs/heads/master 551b5622c -> 05595f649


Fix plan changes in Druid tests caused by [CALCITE-1842]


Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/05595f64
Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/05595f64
Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/05595f64

Branch: refs/heads/master
Commit: 05595f64902aa02c22a1a92c23452d74ceef02fe
Parents: 551b562
Author: Julian Hyde <jhyde@apache.org>
Authored: Mon Jul 10 17:52:31 2017 -0700
Committer: Julian Hyde <jhyde@apache.org>
Committed: Mon Jul 10 17:52:31 2017 -0700

----------------------------------------------------------------------
 .../adapter/druid/DruidDateTimeUtils.java        |  4 ++--
 .../org/apache/calcite/test/DruidAdapterIT.java  | 19 +++++++++++--------
 2 files changed, 13 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/05595f64/druid/src/main/java/org/apache/calcite/adapter/druid/DruidDateTimeUtils.java
----------------------------------------------------------------------
diff --git a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidDateTimeUtils.java
b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidDateTimeUtils.java
index d6065e2..0328882 100644
--- a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidDateTimeUtils.java
+++ b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidDateTimeUtils.java
@@ -98,8 +98,8 @@ public class DruidDateTimeUtils {
             return LocalInterval.create(start, end);
           }
         });
-    if (LOGGER.isInfoEnabled()) {
-      LOGGER.info("Converted time ranges " + ranges + " to interval " + intervals);
+    if (LOGGER.isDebugEnabled()) {
+      LOGGER.debug("Converted time ranges " + ranges + " to interval " + intervals);
     }
     return intervals;
   }

http://git-wip-us.apache.org/repos/asf/calcite/blob/05595f64/druid/src/test/java/org/apache/calcite/test/DruidAdapterIT.java
----------------------------------------------------------------------
diff --git a/druid/src/test/java/org/apache/calcite/test/DruidAdapterIT.java b/druid/src/test/java/org/apache/calcite/test/DruidAdapterIT.java
index 9c88e3a..5cb01c9 100644
--- a/druid/src/test/java/org/apache/calcite/test/DruidAdapterIT.java
+++ b/druid/src/test/java/org/apache/calcite/test/DruidAdapterIT.java
@@ -515,8 +515,8 @@ public class DruidAdapterIT {
   }
 
   @Test public void testSortLimit() {
-    final String explain = "PLAN=EnumerableLimit(offset=[2], fetch=[3])\n"
-        + "  EnumerableInterpreter\n"
+    final String explain = "PLAN=EnumerableInterpreter\n"
+        + "  BindableSort(sort0=[$1], sort1=[$0], dir0=[ASC], dir1=[DESC], offset=[2], fetch=[3])\n"
         + "    DruidQuery(table=[[foodmart, foodmart]], "
         + "intervals=[[1900-01-09T00:00:00.000/2992-01-10T00:00:00.000]], projects=[[$39,
$30]], "
         + "groups=[{0, 1}], aggs=[[]], sort0=[1], sort1=[0], dir0=[ASC], dir1=[DESC])";
@@ -1177,8 +1177,9 @@ public class DruidAdapterIT {
         + "order by s desc limit 3";
     // Cannot use a Druid "topN" query, granularity != "all";
     // have to use "groupBy" query followed by external Sort and fetch.
-    final String explain = "PLAN=EnumerableInterpreter\n"
-        + "  BindableProject(S=[$2], M=[$3], P=[$0])\n"
+    final String explain = "PLAN="
+        + "EnumerableCalc(expr#0..3=[{inputs}], S=[$t2], M=[$t3], P=[$t0])\n"
+        + "  EnumerableInterpreter\n"
         + "    DruidQuery(table=[[foodmart, foodmart]], "
         + "intervals=[[1900-01-09T00:00:00.000/2992-01-10T00:00:00.000]], projects=[[$30,
FLOOR"
         + "($0, FLAG(MONTH)), $89]], groups=[{0, 1}], aggs=[[SUM($2), MAX($2)]], sort0=[2],
"
@@ -1881,11 +1882,13 @@ public class DruidAdapterIT {
         + "from \"foodmart\"\n"
         + "group by floor(\"timestamp\" to MONTH)\n"
         + "order by \"floor_month\" DESC LIMIT 3";
-    sql(sql).explainContains("PLAN=EnumerableLimit(fetch=[3])\n"
-        + "  EnumerableInterpreter\n"
+    final String explain = "PLAN=EnumerableInterpreter\n"
+        + "  BindableSort(sort0=[$0], dir0=[DESC], fetch=[3])\n"
         + "    DruidQuery(table=[[foodmart, foodmart]], "
-        + "intervals=[[1900-01-09T00:00:00.000/2992-01-10T00:00:00.000]], projects=[[FLOOR($0,
"
-        + "FLAG(MONTH))]], groups=[{0}], aggs=[[]], sort0=[0], dir0=[DESC])")
+        + "intervals=[[1900-01-09T00:00:00.000/2992-01-10T00:00:00.000]], "
+        + "projects=[[FLOOR($0, FLAG(MONTH))]], groups=[{0}], aggs=[[]], "
+        + "sort0=[0], dir0=[DESC])";
+    sql(sql).explainContains(explain)
         .queryContains(druidChecker("'queryType':'timeseries'", "'descending':true"))
         .returnsOrdered("floor_month=1997-12-01 00:00:00", "floor_month=1997-11-01 00:00:00",
             "floor_month=1997-10-01 00:00:00");


Mime
View raw message