drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [01/10] drill git commit: DRILL-1737: Fix decimal handling in unit test framework.
Date Sat, 29 Nov 2014 19:16:13 GMT
Repository: drill
Updated Branches:
  refs/heads/master daaa0c35e -> 3a067cf9f


DRILL-1737: Fix decimal handling in unit test framework.


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

Branch: refs/heads/master
Commit: 116e4dc0442532585ca45d79dd682b555bf6baef
Parents: 1a9543f
Author: Jason Altekruse <altekrusejason@gmail.com>
Authored: Tue Nov 25 17:32:29 2014 -0800
Committer: Jason Altekruse <altekrusejason@gmail.com>
Committed: Fri Nov 28 22:28:24 2014 -0800

----------------------------------------------------------------------
 .../src/test/java/org/apache/drill/TestBuilder.java |  2 +-
 .../java/org/apache/drill/TestTestFramework.java    | 16 +++++++---------
 2 files changed, 8 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/116e4dc0/exec/java-exec/src/test/java/org/apache/drill/TestBuilder.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/TestBuilder.java b/exec/java-exec/src/test/java/org/apache/drill/TestBuilder.java
index 9334c6e..e9f7f55 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/TestBuilder.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/TestBuilder.java
@@ -340,7 +340,7 @@ public class TestBuilder {
       case DECIMAL38DENSE:
       case DECIMAL28DENSE:
       case DECIMAL9:
-        precision = String.format("(%d,%d)", type.getScale(), type.getPrecision());
+        precision = String.format("(%d,%d)", type.getPrecision(), type.getScale());
         break;
       default:
         ; // do nothing empty string set above

http://git-wip-us.apache.org/repos/asf/drill/blob/116e4dc0/exec/java-exec/src/test/java/org/apache/drill/TestTestFramework.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/TestTestFramework.java b/exec/java-exec/src/test/java/org/apache/drill/TestTestFramework.java
index eaaae6b..f75e686 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/TestTestFramework.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/TestTestFramework.java
@@ -68,7 +68,6 @@ public class TestTestFramework extends BaseTestQuery{
         .build().run();
   }
 
-  @Ignore("Drill 1737")
   @Test
   public void testDecimalBaseline() throws  Exception {
     // type information can be provided explicitly
@@ -76,19 +75,18 @@ public class TestTestFramework extends BaseTestQuery{
         .sqlQuery("select cast(dec_col as decimal(38,2)) dec_col from cp.`testframework/decimal_test.json`")
         .unOrdered()
         .csvBaselineFile("testframework/decimal_test.tsv")
-        .baselineTypes(Types.withScaleAndPrecision(TypeProtos.MinorType.DECIMAL38SPARSE,
TypeProtos.DataMode.REQUIRED, 38, 2))
+        .baselineTypes(Types.withScaleAndPrecision(TypeProtos.MinorType.DECIMAL38SPARSE,
TypeProtos.DataMode.REQUIRED, 2, 38))
         .baselineColumns("dec_col")
         .build().run();
 
-    // TODO - re-enable once DRILL-1737 is fixed
     // type information can also be left out, this will prompt the result types of the test
query to drive the
     // interpretation of the test file
-//    testBuilder()
-//        .sqlQuery("select cast(dec_col as decimal(38,2)) dec_col from cp.`testframework/decimal_test.json`")
-//        .unOrdered()
-//        .csvBaselineFile("testframework/decimal_test.tsv")
-//        .baselineColumns("dec_col")
-//        .build().run();
+    testBuilder()
+        .sqlQuery("select cast(dec_col as decimal(38,2)) dec_col from cp.`testframework/decimal_test.json`")
+        .unOrdered()
+        .csvBaselineFile("testframework/decimal_test.tsv")
+        .baselineColumns("dec_col")
+        .build().run();
 
     // Or you can provide explicit values to the builder itself to avoid going through the
drill engine at all to
     // populate the baseline results


Mime
View raw message