You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by hg...@apache.org on 2015/06/03 23:57:23 UTC
drill git commit: DRILL-3166: Cost model of functions should account
for field reader arguments
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 <hg...@maprtech.com>
Authored: Thu May 21 14:19:33 2015 -0700
Committer: Hanifi Gunes <hg...@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;
}