drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h.@apache.org
Subject drill git commit: DRILL-3166: Cost model of functions should account for field reader arguments
Date Wed, 03 Jun 2015 21:57:23 GMT
Repository: drill
Updated Branches:
  refs/heads/master acf5566e8 -> 69b39c110


DRILL-3166:  Cost model of functions should account for field reader arguments


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

Branch: refs/heads/master
Commit: 69b39c110b21cdf467555312bff4df95cca055f6
Parents: acf5566
Author: Hanifi Gunes <hgunes@maprtech.com>
Authored: Thu May 21 14:19:33 2015 -0700
Committer: Hanifi Gunes <hgunes@maprtech.com>
Committed: Wed Jun 3 15:00:40 2015 -0700

----------------------------------------------------------------------
 .../org/apache/drill/exec/resolver/TypeCastRules.java   | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/69b39c11/exec/java-exec/src/main/java/org/apache/drill/exec/resolver/TypeCastRules.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/resolver/TypeCastRules.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/resolver/TypeCastRules.java
index ef4bff3..f861586 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/resolver/TypeCastRules.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/resolver/TypeCastRules.java
@@ -848,14 +848,18 @@ public class TypeCastRules {
       }
     }
 
-    for (int i = 0; i < holder.getParamCount(); i++) {
-      MajorType argType = call.args.get(i).getMajorType();
-      MajorType parmType = holder.getParmMajorType(i);
+    final int numOfArgs = holder.getParamCount();
+    for (int i = 0; i < numOfArgs; i++) {
+      final MajorType argType = call.args.get(i).getMajorType();
+      final MajorType parmType = holder.getParmMajorType(i);
 
       //@Param FieldReader will match any type
       if (holder.isFieldReader(i)) {
 //        if (Types.isComplex(call.args.get(i).getMajorType()) ||Types.isRepeated(call.args.get(i).getMajorType())
)
-          continue;
+        // add the max cost when encountered with a field reader considering that it is the
most expensive factor
+        // contributing to the cost.
+        cost += ResolverTypePrecedence.MAX_IMPLICIT_CAST_COST;
+        continue;
 //        else
 //          return -1;
       }


Mime
View raw message