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

Switch to Threaded View
Drill >> mail # dev >> [5/6] git commit: DRILL-259: Implicit cast functionality


Copy link to this message
-
[5/6] git commit: DRILL-259: Implicit cast functionality
DRILL-259: Implicit cast functionality

Includes following changes:

Implicit cast : WIP.

Implicit cast: work in progress 2.

implicit_cast: workin in progress 3.

implicit cast : work in progress. Prototype works.

Implicit cast: add unit testcase. Handle null vs non-null type.

Implicit cast: add unit test. change comparision operator's allsame from true to false.

Drill-259: implicit cast. Rebase on Drill-316 explicit cast branch.

DRILL-259: implicit cast . reverse change to codegenerator.

DRILL-259: implicit cast. code clean.

DRILL-259: code clean.

Drill-259: add apache license to 7 new java files. reverse the change to pom.xml

Drill-259: minor change to test case.

Drill-259: implicit cast - process NullExpression. Convert NullExpression into TypedNullConstant.

Drill-259: implicit cast. Revise according to review comments.
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/db020369
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/db020369
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/db020369

Branch: refs/heads/master
Commit: db0203696c41e742a90bb7925c6e35f2407e80e8
Parents: 3694542
Author: Jinfeng Ni <[EMAIL PROTECTED]>
Authored: Fri Dec 13 09:59:07 2013 -0800
Committer: Jacques Nadeau <[EMAIL PROTECTED]>
Committed: Tue Jan 14 08:40:41 2014 -0800

----------------------------------------------------------------------
 .../common/expression/ArgumentValidators.java   |   4 +-
 .../common/expression/TypedNullConstant.java    |  55 +
 .../common/expression/fn/CastFunctionDefs.java  |  48 +-
 .../common/expression/fn/MathFunctions.java     |   2 +-
 .../org/apache/drill/exec/ExecConstants.java    |   1 -
 .../drill/exec/expr/EvaluationVisitor.java      |   5 +-
 .../exec/expr/ExpressionTreeMaterializer.java   |  21 +-
 .../drill/exec/expr/ImplicitCastBuilder.java    | 168 ++++
 .../drill/exec/expr/fn/DrillFuncHolder.java     |  55 +-
 .../expr/fn/FunctionImplementationRegistry.java |  21 +-
 .../exec/physical/impl/aggregate/AggBatch.java  |   4 +-
 .../physical/impl/filter/FilterRecordBatch.java |   4 +-
 .../exec/physical/impl/join/MergeJoinBatch.java |   4 +-
 .../impl/mergereceiver/MergingRecordBatch.java  |   3 +-
 .../OrderedPartitionRecordBatch.java            |   4 +-
 .../PartitionSenderRootExec.java                |   4 +-
 .../impl/project/ProjectRecordBatch.java        |   3 +-
 .../exec/physical/impl/sort/SortBatch.java      |   2 +-
 .../exec/resolver/DefaultFunctionResolver.java  |  56 +-
 .../drill/exec/resolver/FunctionResolver.java   |  18 +
 .../exec/resolver/FunctionResolverFactory.java  |  27 +-
 .../exec/resolver/OperatorFunctionResolver.java |  52 -
 .../exec/resolver/ResolverTypePrecedence.java   |  94 +-
 .../drill/exec/resolver/TypeCastRules.java      | 993 ++++++++++---------
 .../exec/resolver/UDFFunctionResolver.java      |  17 -
 .../org/apache/drill/exec/util/VectorUtil.java  |   6 +-
 .../apache/drill/exec/expr/ExpressionTest.java  |   5 +-
 .../impl/TestImplicitCastFunctions.java         | 179 ++++
 .../record/ExpressionTreeMaterializerTest.java  |  13 +-
 .../functions/cast/testICastConstant.json       |  54 +
 .../functions/cast/testICastMockCol.json        |  45 +
 .../functions/cast/testICastNullExp.json        |  43 +
 pom.xml                                         |  10 +-
 sqlline                                         |   1 -
 34 files changed, 1339 insertions(+), 682 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/db020369/common/src/main/java/org/apache/drill/common/expression/ArgumentValidators.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/expression/ArgumentValidators.java b/common/src/main/java/org/apache/drill/common/expression/ArgumentValidators.java
index cd30a06..da46645 100644
+++ b/common/src/main/java/org/apache/drill/common/expression/ArgumentValidators.java
@@ -110,11 +110,11 @@ public class ArgumentValidators {
   public static class ComparableArguments extends PredicateValidator {
 
     public ComparableArguments(int argCount, MajorType... allowedTypes) {
-      super(argCount, new ComparableChecker(), true);
+      super(argCount, new ComparableChecker(), false);
     }
 
     public ComparableArguments(int minArguments, int maxArguments, MajorType... allowedTypes) {
-      super(minArguments, maxArguments, new ComparableChecker(), true);
+      super(minArguments, maxArguments, new ComparableChecker(), false);
     }
 
     public static class ComparableChecker implements Predicate<MajorType> {

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/db020369/common/src/main/java/org/apache/drill/common/expression/TypedNullConstant.java
diff --git a/common/src/main/java/org/apache/drill/common/expression/TypedNullConstant.java b/common/src/main/java/org/apache/drill/common/expression/TypedNullConstant.java
new file mode 100644
index 0000000..1efb029
+++ b/common/src/main/java/org/apache/drill/common/expression/TypedNullConstant.java
@@ -0,0 +1,55 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissio