calcite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jcama...@apache.org
Subject calcite git commit: [CALCITE-1722] Druid adapter uses un-scaled value of DECIMAL literals (Slim Bouguerra) [Forced Update!]
Date Mon, 27 Mar 2017 19:18:48 GMT
Repository: calcite
Updated Branches:
  refs/heads/master ecc1623fb -> 370dfdac5 (forced update)


[CALCITE-1722] Druid adapter uses un-scaled value of DECIMAL literals (Slim Bouguerra)

Close apache/calcite#411


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

Branch: refs/heads/master
Commit: 370dfdac54de00c883869954cfaaf5e20f0f2519
Parents: aa0bf32
Author: Slim Bouguerra <slim.bouguerra@gmail.com>
Authored: Mon Mar 27 20:07:07 2017 +0100
Committer: Jesus Camacho Rodriguez <jcamacho@apache.org>
Committed: Mon Mar 27 20:18:35 2017 +0100

----------------------------------------------------------------------
 .../java/org/apache/calcite/adapter/druid/DruidQuery.java    | 2 +-
 .../test/java/org/apache/calcite/test/DruidAdapterIT.java    | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/370dfdac/druid/src/main/java/org/apache/calcite/adapter/druid/DruidQuery.java
----------------------------------------------------------------------
diff --git a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidQuery.java b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidQuery.java
index 9378e47..f8211a4 100644
--- a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidQuery.java
+++ b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidQuery.java
@@ -906,7 +906,7 @@ public class DruidQuery extends AbstractRelNode implements BindableRel
{
         return tr(e, 0, set);
 
       case LITERAL:
-        return ((RexLiteral) e).getValue2().toString();
+        return ((RexLiteral) e).getValue3().toString();
 
       case FLOOR:
         final RexCall call = (RexCall) e;

http://git-wip-us.apache.org/repos/asf/calcite/blob/370dfdac/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 312ff63..e673c9c 100644
--- a/druid/src/test/java/org/apache/calcite/test/DruidAdapterIT.java
+++ b/druid/src/test/java/org/apache/calcite/test/DruidAdapterIT.java
@@ -1496,6 +1496,14 @@ public class DruidAdapterIT {
     sql(sql).queryContains(druidChecker("{\"queryType\":\"select\""));
   }
 
+  @Test public void testFilterOnDouble() {
+    String sql = "select \"product_id\" from \"foodmart\"\n"
+        + "where cast(\"product_id\" as double) < 0.41024 and \"product_id\" < 12223";
+    sql(sql).queryContains(
+        druidChecker("\"type\":\"bound\",\"dimension\":\"product_id\",\"upper\":\"0.41024\"",
+            "\"upper\":\"12223\""));
+  }
+
 }
 
 // End DruidAdapterIT.java


Mime
View raw message