Return-Path: X-Original-To: apmail-drill-commits-archive@www.apache.org Delivered-To: apmail-drill-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D281F175A8 for ; Wed, 3 Jun 2015 21:57:23 +0000 (UTC) Received: (qmail 97706 invoked by uid 500); 3 Jun 2015 21:57:23 -0000 Delivered-To: apmail-drill-commits-archive@drill.apache.org Received: (qmail 97674 invoked by uid 500); 3 Jun 2015 21:57:23 -0000 Mailing-List: contact commits-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: commits@drill.apache.org Delivered-To: mailing list commits@drill.apache.org Received: (qmail 97665 invoked by uid 99); 3 Jun 2015 21:57:23 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jun 2015 21:57:23 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9E2DDE2F9B; Wed, 3 Jun 2015 21:57:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hg@apache.org To: commits@drill.apache.org Message-Id: <9d8a617e34a049e1a8fe19e710070523@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: drill git commit: DRILL-3166: Cost model of functions should account for field reader arguments Date: Wed, 3 Jun 2015 21:57:23 +0000 (UTC) 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 Authored: Thu May 21 14:19:33 2015 -0700 Committer: Hanifi Gunes 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; }