drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jacq...@apache.org
Subject [08/12] git commit: DRILL-1099: Inject space (' ') as the default second argument to [lbr]trim
Date Thu, 03 Jul 2014 17:45:21 GMT
DRILL-1099: Inject space (' ') as the default second argument to [lbr]trim

* Optiq already handles this for "trim".


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

Branch: refs/heads/master
Commit: de8f3592ee716351b1694f48b797c89e2837caa7
Parents: dedff8c
Author: Cliff Buchanan <cbuchanan@maprtech.com>
Authored: Wed Jul 2 13:20:37 2014 -0700
Committer: Aditya Kishore <aditya@maprtech.com>
Committed: Thu Jul 3 02:11:24 2014 -0700

----------------------------------------------------------------------
 .../java/org/apache/drill/exec/planner/logical/DrillOptiq.java  | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/de8f3592/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillOptiq.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillOptiq.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillOptiq.java
index ff4a7d3..428ff6b 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillOptiq.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillOptiq.java
@@ -312,6 +312,11 @@ public class DrillOptiq {
         trimArgs.add(args.get(1));
 
         return FunctionCallFactory.createExpression(trimFunc, trimArgs);
+      } else if (functionName.equals("ltrim") || functionName.equals("rtrim") || functionName.equals("btrim"))
{
+        if (args.size() == 1) {
+          args.add(ValueExpressions.getChar(" "));
+        }
+        return FunctionCallFactory.createExpression(functionName, args);
       } else if (functionName.equals("date_part")) {
         // Rewrite DATE_PART functions as extract functions
         // assert that the function has exactly two arguments


Mime
View raw message