tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jihoon...@apache.org
Subject [01/18] git commit: TAJO-347: Fix bug when to call function with insensitive function name. (DaeMyung Kang via hyunsik)
Date Tue, 03 Dec 2013 11:50:56 GMT
Updated Branches:
  refs/heads/DAG-execplan 0cbd968ca -> dc24dbc1e


TAJO-347: Fix bug when to call function with insensitive function name. (DaeMyung Kang via
hyunsik)


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

Branch: refs/heads/DAG-execplan
Commit: dc56c8e714c1c930e6b572bfc9b5aed302075d12
Parents: 02fd6cb
Author: Hyunsik Choi <hyunsik@apache.org>
Authored: Sun Dec 1 12:52:42 2013 +0900
Committer: Hyunsik Choi <hyunsik@apache.org>
Committed: Sun Dec 1 12:54:27 2013 +0900

----------------------------------------------------------------------
 CHANGES.txt                                                 | 9 +++++++--
 .../src/main/java/org/apache/tajo/algebra/FunctionExpr.java | 4 ++--
 .../engine/function/TestStringOperatorsAndFunctions.java    | 8 ++++++++
 3 files changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/dc56c8e7/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index cd6e9f8..b99cc69 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -52,13 +52,18 @@ Release 0.8.0 - unreleased
 
   BUG FIXES
 
+    TAJO-347: Fix bug when to call function with insensitive function name. 
+    (DaeMyung Kang via hyunsik)
+
     TAJO-345: MergeScanner should support projectable storages. (jihoon)
 
-    TAJO-290: TajoDataType.Type.NULL should be NULL_TYPE. (DaeMyung Kang via jinho)
+    TAJO-290: TajoDataType.Type.NULL should be NULL_TYPE. (DaeMyung Kang via 
+    jinho)
 
     TAJO-332: Invalid row count of CSVScanner. (jinho)
 
-    TAJO-326: In ExecutionBlock, isRoot() and isLeafBlock() return invalid values. (jihoon)
+    TAJO-326: In ExecutionBlock, isRoot() and isLeafBlock() return invalid 
+    values. (jihoon)
 
     TAJO-296: Late registration of Tajo workers. (hyoungjunkim via hyunsik)
 

http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/dc56c8e7/tajo-algebra/src/main/java/org/apache/tajo/algebra/FunctionExpr.java
----------------------------------------------------------------------
diff --git a/tajo-algebra/src/main/java/org/apache/tajo/algebra/FunctionExpr.java b/tajo-algebra/src/main/java/org/apache/tajo/algebra/FunctionExpr.java
index 7c8b33c..008bfc0 100644
--- a/tajo-algebra/src/main/java/org/apache/tajo/algebra/FunctionExpr.java
+++ b/tajo-algebra/src/main/java/org/apache/tajo/algebra/FunctionExpr.java
@@ -38,7 +38,7 @@ public class FunctionExpr extends Expr {
     if (type != OpType.Function && type != OpType.CountRowsFunction) {
       throw new IllegalArgumentException("FunctionExpr cannot accept " + type + "type");
     }
-    this.signature = signature;
+    this.signature = signature.toLowerCase();
   }
 
   protected FunctionExpr(OpType type, String signature, Expr [] params) {
@@ -46,7 +46,7 @@ public class FunctionExpr extends Expr {
     if (type != OpType.Function && type != OpType.GeneralSetFunction) {
       throw new IllegalArgumentException("FunctionExpr cannot accept " + type + "type");
     }
-    this.signature = signature;
+    this.signature = signature.toLowerCase();
     setParams(params);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/dc56c8e7/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/function/TestStringOperatorsAndFunctions.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/function/TestStringOperatorsAndFunctions.java
b/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/function/TestStringOperatorsAndFunctions.java
index 27b9355..f9da0c4 100644
--- a/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/function/TestStringOperatorsAndFunctions.java
+++ b/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/function/TestStringOperatorsAndFunctions.java
@@ -53,6 +53,14 @@ public class TestStringOperatorsAndFunctions extends ExprTestBase {
   }
 
   @Test
+  public void testFunctionCallIngoreCases() throws IOException {
+    testSimpleEval("select ltrim(' trim') ", new String[]{"trim"});
+    testSimpleEval("select LTRIM(' trim') ", new String[]{"trim"});
+    testSimpleEval("select lTRim(' trim') ", new String[]{"trim"});
+    testSimpleEval("select ltrIM(' trim') ", new String[]{"trim"});
+  }
+
+  @Test
   public void testLTrim() throws IOException {
     Schema schema = new Schema();
     schema.addColumn("col1", TEXT);


Mime
View raw message