Fix ExprLexer to correctly deserialize decimal data type.

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

Branch: refs/heads/master
Commit: 935095ef15ecef13eac194bdcc48314f1d59a270
Parents: 68f4bdb
Author: Mehant Baid <[email protected]>
Authored: Tue May 20 15:26:01 2014 -0700
Committer: Mehant Baid <[email protected]>
Committed: Tue May 20 16:56:38 2014 -0700

----------------------------------------------------------------------
 .../apache/drill/common/expression/parser/ExprLexer.g   | 12 ++++++------
 .../src/test/resources/decimal/cast_float_decimal.json  |  2 +-
 .../src/test/resources/decimal/cast_simple_decimal.json | 10 +++++-----
 .../decimal/test_decimal_sparse_dense_dense.json        | 10 +++++-----
 4 files changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/935095ef/common/src/main/antlr3/org/apache/drill/common/expression/parser/ExprLexer.g
----------------------------------------------------------------------
diff --git 
a/common/src/main/antlr3/org/apache/drill/common/expression/parser/ExprLexer.g 
b/common/src/main/antlr3/org/apache/drill/common/expression/parser/ExprLexer.g
index 58ed215..e3a0e34 100644
--- 
a/common/src/main/antlr3/org/apache/drill/common/expression/parser/ExprLexer.g
+++ 
b/common/src/main/antlr3/org/apache/drill/common/expression/parser/ExprLexer.g
@@ -55,12 +55,12 @@ INTERVAL : 'interval' | 'INTERVAL';
 INTERVALYEAR : 'intervalyear' | 'INTERVALYEAR';
 INTERVALDAY : 'intervalday' | 'INTERVALDAY';
 Period : '.';
-DECIMAL9 : 'decimal9';
-DECIMAL18 : 'decimal18';
-DECIMAL28DENSE : 'decimal28dense';
-DECIMAL28SPARSE : 'decimal28sparse';
-DECIMAL38DENSE : 'decimal38dense';
-DECIMAL38SPARSE : 'decimal38sparse';
+DECIMAL9 : 'decimal9' | 'DECIMAL9';
+DECIMAL18 : 'decimal18' | 'DECIMAL18';
+DECIMAL28DENSE : 'decimal28dense' | 'DECIMAL28DENSE';
+DECIMAL28SPARSE : 'decimal28sparse' | 'DECIMAL28SPARSE';
+DECIMAL38DENSE : 'decimal38dense' | 'DECIMAL38DENSE';
+DECIMAL38SPARSE : 'decimal38sparse' | 'DECIMAL38SPARSE';
 Or       : '||' | 'or' | 'OR' | 'Or';
 And      : '&&' | 'and' | 'AND' ;
 Equals   : '==' | '=';

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/935095ef/exec/java-exec/src/test/resources/decimal/cast_float_decimal.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/decimal/cast_float_decimal.json 
b/exec/java-exec/src/test/resources/decimal/cast_float_decimal.json
index 33732ae..b9e05d3 100644
--- a/exec/java-exec/src/test/resources/decimal/cast_float_decimal.json
+++ b/exec/java-exec/src/test/resources/decimal/cast_float_decimal.json
@@ -31,7 +31,7 @@
     "pop" : "project",
     "@id" : 4,
     "exprs" : [ {
-      "ref" : "DECIMAL9",
+      "ref" : "DECIMAL_9",
       "expr" : " cast(F4 as decimal9(9, 4))  "
     },
     {"ref": "DECIMAL38", "expr" : "cast(F8 as decimal38sparse(38, 4))"}

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/935095ef/exec/java-exec/src/test/resources/decimal/cast_simple_decimal.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/decimal/cast_simple_decimal.json 
b/exec/java-exec/src/test/resources/decimal/cast_simple_decimal.json
index 279de3c..0291724 100644
--- a/exec/java-exec/src/test/resources/decimal/cast_simple_decimal.json
+++ b/exec/java-exec/src/test/resources/decimal/cast_simple_decimal.json
@@ -19,10 +19,10 @@
     "pop" : "project",
     "@id" : 2,
     "exprs" : [ {
-      "ref" : "DECIMAL9",
+      "ref" : "DECIMAL_9",
       "expr" : " (cast(DEC9 as decimal9(9, 4))) "
     },
-    { "ref" : "DECIMAL18", "expr": "(cast(DEC18 as decimal18(18, 9)))" }
+    { "ref" : "DECIMAL_18", "expr": "(cast(DEC18 as decimal18(18, 9)))" }
     ],
 
     "child" : 1
@@ -31,10 +31,10 @@
     "pop" : "project",
     "@id" : 4,
     "exprs" : [ {
-      "ref" : "DECIMAL9",
-      "expr" : " cast(DECIMAL9 as varchar(100))  "
+      "ref" : "DECIMAL_9",
+      "expr" : " cast(DECIMAL_9 as varchar(100))  "
     },
-    {"ref": "DECIMAL18", "expr" : "cast(DECIMAL18 as varchar(100))"}
+    {"ref": "DECIMAL_18", "expr" : "cast(DECIMAL_18 as varchar(100))"}
     ],
 
     "child" : 2

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/935095ef/exec/java-exec/src/test/resources/decimal/test_decimal_sparse_dense_dense.json
----------------------------------------------------------------------
diff --git 
a/exec/java-exec/src/test/resources/decimal/test_decimal_sparse_dense_dense.json
 
b/exec/java-exec/src/test/resources/decimal/test_decimal_sparse_dense_dense.json
index 03add9a..b1a2c43 100644
--- 
a/exec/java-exec/src/test/resources/decimal/test_decimal_sparse_dense_dense.json
+++ 
b/exec/java-exec/src/test/resources/decimal/test_decimal_sparse_dense_dense.json
@@ -19,7 +19,7 @@
     "pop" : "project",
     "@id" : 2,
     "exprs" : [ {
-      "ref" : "DECIMAL28SPARSE",
+      "ref" : "DECIMAL28SPARSE_1",
       "expr" : " (cast(DEC9 as decimal28sparse(28, 4))) "
     }
     ],
@@ -30,8 +30,8 @@
     "pop" : "project",
     "@id" : 3,
     "exprs" : [ {
-      "ref" : "DECIMAL28DENSE",
-      "expr" : " cast(DECIMAL28SPARSE as decimal28dense(28, 4))  "
+      "ref" : "DECIMAL28DENSE_1",
+      "expr" : " cast(DECIMAL28SPARSE_1 as decimal28dense(28, 4))  "
     }
     ],
 
@@ -41,8 +41,8 @@
     "pop" : "project",
     "@id" : 4,
     "exprs" : [ {
-      "ref" : "DECIMAL38DENSE",
-      "expr" : " cast(DECIMAL28DENSE as decimal38dense(38, 4))  "
+      "ref" : "DECIMAL38DENSE_1",
+      "expr" : " cast(DECIMAL28DENSE_1 as decimal38dense(38, 4))  "
     }
     ],
 

Reply via email to