You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by me...@apache.org on 2015/04/27 22:48:01 UTC

[3/4] drill git commit: DRILL-2753: Don't generate cross numeric type comparison functions

DRILL-2753: Don't generate cross numeric type comparison functions


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

Branch: refs/heads/master
Commit: e33ffa2197306ba833f0d5ea867969781cd733cc
Parents: 7289cab
Author: Mehant Baid <me...@gmail.com>
Authored: Fri Apr 17 14:15:37 2015 -0700
Committer: Mehant Baid <me...@gmail.com>
Committed: Mon Apr 27 13:08:17 2015 -0700

----------------------------------------------------------------------
 .../src/main/codegen/data/ComparisonTypesMain.tdd     | 14 +++++---------
 .../java/org/apache/drill/TestFunctionsQuery.java     | 11 +++++++++++
 2 files changed, 16 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/e33ffa21/exec/java-exec/src/main/codegen/data/ComparisonTypesMain.tdd
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/codegen/data/ComparisonTypesMain.tdd b/exec/java-exec/src/main/codegen/data/ComparisonTypesMain.tdd
index d5d3f30..a647535 100644
--- a/exec/java-exec/src/main/codegen/data/ComparisonTypesMain.tdd
+++ b/exec/java-exec/src/main/codegen/data/ComparisonTypesMain.tdd
@@ -34,15 +34,11 @@
       ],
       mode: "primitive"},
 
-    # Group:  Numeric types cross-comparable with Java primitive-type operators:
-    {comparables: [
-      "Int",
-      "BigInt",
-      "Float4",
-      "Float8"
-      ],
-      mode: "primitive"},
-
+    # Group:  Numeric types comparable with Java primitive-type operators:
+    {comparables: ["Int"], mode: "primitive"},
+    {comparables: ["BigInt"], mode: "primitive"},
+    {comparables: ["Float4"], mode: "primitive"},
+    {comparables: ["Float8"], mode: "primitive"},
 
     # Date/time types other than IntervalDay or Interval (comparable with Java
     # primitive-type operators):

http://git-wip-us.apache.org/repos/asf/drill/blob/e33ffa21/exec/java-exec/src/test/java/org/apache/drill/TestFunctionsQuery.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/TestFunctionsQuery.java b/exec/java-exec/src/test/java/org/apache/drill/TestFunctionsQuery.java
index 4b9001f..67131c1 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/TestFunctionsQuery.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/TestFunctionsQuery.java
@@ -828,4 +828,15 @@ public class TestFunctionsQuery extends BaseTestQuery {
         .baselineValues(true, true, true, true, true, true, true)
         .go();
   }
+
+  @Test
+  public void testImplicitCastVarcharToDouble() throws Exception {
+    // tests implicit cast from varchar to double
+    testBuilder()
+        .sqlQuery("select `integer` i, `float` f from cp.`jsoninput/input1.json` where `float` = '1.2'")
+        .unOrdered()
+        .baselineColumns("i", "f")
+        .baselineValues(2001l, 1.2d)
+        .go();
+  }
 }