Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Drill >> mail # dev >> [49/53] [abbrv] git commit: Add workspace field and function setup support. Add alternate function Add slightly better filter test.


Copy link to this message
-
[49/53] [abbrv] git commit: Add workspace field and function setup support. Add alternate function Add slightly better filter test.
Add workspace field and function setup support.
Add alternate function
Add slightly better filter test.
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/7779a723
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/7779a723
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/7779a723

Branch: refs/heads/master
Commit: 7779a7232d292f5a7f4f2838c04687360d19d90b
Parents: 65e2cfc
Author: Jacques Nadeau <[EMAIL PROTECTED]>
Authored: Wed Jul 17 20:06:00 2013 -0700
Committer: Jacques Nadeau <[EMAIL PROTECTED]>
Committed: Fri Jul 19 14:53:31 2013 -0700

----------------------------------------------------------------------
 .../common/expression/ArgumentValidators.java   |   8 +-
 .../drill/common/expression/FunctionCall.java   |   4 +
 .../common/expression/FunctionRegistry.java     |   5 +-
 .../drill/common/expression/NoArgValidator.java |  21 ++++
 .../apache/drill/exec/expr/CodeGenerator.java   |   2 +
 .../drill/exec/expr/EvaluationVisitor.java      |   5 +-
 .../drill/exec/expr/annotations/WorkSpace.java  |   2 +-
 .../drill/exec/expr/fn/FunctionConverter.java   |  28 ++++--
 .../drill/exec/expr/fn/FunctionHolder.java      | 100 +++++++++++++------
 .../drill/exec/expr/fn/ImportGrabber.java       |  55 ++++++++++
 .../exec/expr/fn/MethodGrabbingVisitor.java     |   4 +
 .../drill/exec/expr/fn/impl/Alternator.java     |  49 +++++++++
 .../apache/drill/exec/vector/ValueVector.java   |   1 -
 .../src/main/resources/drill-module.conf        |   3 +
 .../physical/impl/filter/TestSimpleFilter.java  |   3 +-
 .../src/test/resources/filter/test1.json        |   2 +-
 16 files changed, 239 insertions(+), 53 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/7779a723/sandbox/prototype/common/src/main/java/org/apache/drill/common/expression/ArgumentValidators.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/common/src/main/java/org/apache/drill/common/expression/ArgumentValidators.java b/sandbox/prototype/common/src/main/java/org/apache/drill/common/expression/ArgumentValidators.java
index f30733d..b745277 100644
--- a/sandbox/prototype/common/src/main/java/org/apache/drill/common/expression/ArgumentValidators.java
+++ b/sandbox/prototype/common/src/main/java/org/apache/drill/common/expression/ArgumentValidators.java
@@ -37,12 +37,12 @@ public class ArgumentValidators {
 
     public AnyTypeAllowed(int argCount) {
       super();
-      argumentCount = Ranges.singleton(argCount);
+      argumentCount = Range.singleton(argCount);
     }
 
     public AnyTypeAllowed(int minArguments, int maxArguments) {
       super();
-      argumentCount = Ranges.closedOpen(minArguments, maxArguments);
+      argumentCount = Range.closedOpen(minArguments, maxArguments);
     }
 
     @Override
@@ -66,14 +66,14 @@ public class ArgumentValidators {
 
     public PredicateValidator(int argCount, Predicate<MajorType> predicate, boolean allSame) {
       super();
-      this.argumentCount = Ranges.singleton(argCount);
+      this.argumentCount = Range.singleton(argCount);
       this.predicate = predicate;
       this.allSame = allSame;
     }
 
     public PredicateValidator(int minArguments, int maxArguments, Predicate<MajorType> predicate, boolean allSame) {
       super();
-      this.argumentCount = Ranges.closedOpen(minArguments, maxArguments);
+      this.argumentCount = Range.closedOpen(minArguments, maxArguments);
       this.predicate = predicate;
       this.allSame = allSame;
     }

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/7779a723/sandbox/prototype/common/src/main/java/org/apache/drill/common/expression/FunctionCall.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/common/src/main/java/org/apache/drill/common/expression/FunctionCall.java b/sandbox/prototype/common/src/main/java/org/apache/drill/common/expression/FunctionCall.java
index e13e87e..d27b584 100644
+++ b/sandbox/prototype/common/src/main/java/org/apache/drill/common/expression/FunctionCall.java
@@ -24,6 +24,7 @@ import org.apache.drill.common.expression.visitors.ExprVisitor;
 import org.apache.drill.common.types.TypeProtos.MajorType;
 
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Lists;
 
 public class FunctionCall extends LogicalExpressionBase implements Iterable<LogicalExpression> {
   private final FunctionDefinition func;
@@ -33,6 +34,9 @@ public class FunctionCall extends LogicalExpressionBase implements Iterable<Logi
   public FunctionCall(FunctionDefinition func, List<LogicalExpression> args, ExpressionPosition pos) {
     super(pos);
     this.func = func;
+    
+    if(args == null) args = Lists.newArrayList();
+    
     if (!(args instanceof ImmutableList)) {
       args = ImmutableList.copyOf(args);
     }

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/7779a723/sandbox/prototype/common/src/main/java/org/apache/drill/common/expression/FunctionRegistry.java
diff --git a/sandbox/prototype/common/src/main/java/org/apache/drill/common/expression/FunctionRegistry.java b/sandbox/prototype/common/src/main/java/org/apache/drill/common/expression/FunctionRegistry.java
index ed2c63e..28fa2db 100644
+++ b/sandbox/prototype/common/src/main/java/org/apache/drill/common/expression/FunctionRegistry.java
@@ -32,7 +32,8 @@ import org.apache.drill.common.util.PathScanner;
 import com.google.common.collect.Lists;
 
 public class FunctionRegistry {
-
+  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(FunctionRegistry.class);
+  
   private final Map<String, FunctionDefinition> funcMap;
 
   public FunctionRegistry(DrillConfig config){
@@ -44,7 +45,9 @@ public class FunctionRegistry {
         FunctionDefinition[] defs = p.getFunctionDefi