You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by am...@apache.org on 2015/05/03 22:36:14 UTC

drill git commit: DRILL-2943: Parse uppercase 'E' for scientific notation.

Repository: drill
Updated Branches:
  refs/heads/master b22ab2437 -> f240ac2a3


DRILL-2943: Parse uppercase 'E' for scientific notation.


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

Branch: refs/heads/master
Commit: f240ac2a353efb420dadc4bee8e6aae8df2937f1
Parents: b22ab24
Author: Aman Sinha <as...@maprtech.com>
Authored: Sun May 3 11:09:19 2015 -0700
Committer: Aman Sinha <as...@maprtech.com>
Committed: Sun May 3 13:28:06 2015 -0700

----------------------------------------------------------------------
 .../org/apache/drill/common/expression/parser/ExprLexer.g |  2 +-
 .../java/org/apache/drill/exec/expr/ExpressionTest.java   | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/f240ac2a/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 604b397..a881b5c 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
@@ -95,7 +95,7 @@ Bool
   ;
 
 Number
-  :  Int ('.' Digit*)? ('e' ('+' | '-')? Digit*)?
+  :  Int ('.' Digit*)? (('e' | 'E') ('+' | '-')? Digit*)?
   ;
 
 //Float

http://git-wip-us.apache.org/repos/asf/drill/blob/f240ac2a/exec/java-exec/src/test/java/org/apache/drill/exec/expr/ExpressionTest.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/expr/ExpressionTest.java b/exec/java-exec/src/test/java/org/apache/drill/exec/expr/ExpressionTest.java
index dd14106..239a099 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/expr/ExpressionTest.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/expr/ExpressionTest.java
@@ -62,6 +62,16 @@ public class ExpressionTest extends ExecTest {
   }
 
   @Test
+  public void testExprParseUpperExponent(@Injectable RecordBatch batch) throws Exception {
+    getExpressionCode("multiply(`$f0`, 1.0E-4)", batch);
+  }
+
+  @Test
+  public void testExprParseLowerExponent(@Injectable RecordBatch batch) throws Exception {
+    getExpressionCode("multiply(`$f0`, 1.0e-4)", batch);
+  }
+
+  @Test
   public void testSpecial(final @Injectable RecordBatch batch, @Injectable ValueVector vector) throws Exception {
     final TypedFieldId tfid = new TypedFieldId(Types.optional(MinorType.INT), false, 0);