You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by Mehant Baid <ba...@gmail.com> on 2014/04/29 04:57:32 UTC

Review Request 20825: ExpressionTreeMaterializer may inject incorrect implicit casts

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/20825/
-----------------------------------------------------------

Review request for drill and Jinfeng Ni.


Bugs: DRILL-584
    https://issues.apache.org/jira/browse/DRILL-584


Repository: drill-git


Description
-------

In ExpressionTreeMaterializer.visitFunctionCall() we try to get a best match between the DrillFuncHolder and the input call. We may match the input call with a DrillFuncHolder whose argument type is different from that of the input, but is allowed to be implicitly cast as per the precedence rules.

However when we inject implicit casts to compensate for the difference in argument types, we again use the same matching method to resolve the implicit cast to DrillFuncHolder. In the case of implicit casts, we should not match with a DrillFuncHolder that has different argument types than the input. We should return only the DrillFuncHolder that exactly matches the argument types and if no such holder is present should return NULL.

Added a new FunctionResolver, ExactFunctionResolver which returns a DrillFuncHolder only when there is an exact match of argument types. This is invoked when we are trying to inject implicit casts.


Diffs
-----

  exec/java-exec/src/main/java/org/apache/drill/exec/expr/ExpressionTreeMaterializer.java a602d82 
  exec/java-exec/src/main/java/org/apache/drill/exec/resolver/ExactFunctionResolver.java PRE-CREATION 
  exec/java-exec/src/main/java/org/apache/drill/exec/resolver/FunctionResolverFactory.java a710e44 

Diff: https://reviews.apache.org/r/20825/diff/


Testing
-------


Thanks,

Mehant Baid


Re: Review Request 20825: ExpressionTreeMaterializer may inject incorrect implicit casts

Posted by Jinfeng Ni <jn...@maprtech.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/20825/#review45433
-----------------------------------------------------------

Ship it!


Ship It!

- Jinfeng Ni


On April 28, 2014, 7:57 p.m., Mehant Baid wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/20825/
> -----------------------------------------------------------
> 
> (Updated April 28, 2014, 7:57 p.m.)
> 
> 
> Review request for drill and Jinfeng Ni.
> 
> 
> Bugs: DRILL-584
>     https://issues.apache.org/jira/browse/DRILL-584
> 
> 
> Repository: drill-git
> 
> 
> Description
> -------
> 
> In ExpressionTreeMaterializer.visitFunctionCall() we try to get a best match between the DrillFuncHolder and the input call. We may match the input call with a DrillFuncHolder whose argument type is different from that of the input, but is allowed to be implicitly cast as per the precedence rules.
> 
> However when we inject implicit casts to compensate for the difference in argument types, we again use the same matching method to resolve the implicit cast to DrillFuncHolder. In the case of implicit casts, we should not match with a DrillFuncHolder that has different argument types than the input. We should return only the DrillFuncHolder that exactly matches the argument types and if no such holder is present should return NULL.
> 
> Added a new FunctionResolver, ExactFunctionResolver which returns a DrillFuncHolder only when there is an exact match of argument types. This is invoked when we are trying to inject implicit casts.
> 
> 
> Diffs
> -----
> 
>   exec/java-exec/src/main/java/org/apache/drill/exec/expr/ExpressionTreeMaterializer.java a602d82 
>   exec/java-exec/src/main/java/org/apache/drill/exec/resolver/ExactFunctionResolver.java PRE-CREATION 
>   exec/java-exec/src/main/java/org/apache/drill/exec/resolver/FunctionResolverFactory.java a710e44 
> 
> Diff: https://reviews.apache.org/r/20825/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Mehant Baid
> 
>