[ 
https://issues.apache.org/jira/browse/HIVE-67?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12656800#action_12656800
 ] 

David Phillips commented on HIVE-67:
------------------------------------

This should be resolved "Invalid" as SQL (due to it's declarative nature) does 
not define subexpression evaluation order.  For example, see "4.2.12. 
Expression Evaluation Rules":

http://www.postgresql.org/docs/8.3/interactive/sql-expressions.html#SYNTAX-EXPRESS-EVAL

As mentioned at the above link, CASE can be used to force evaluation order when 
necessary.  Defining evaluation order allows users to write code that is 
non-standard and invalid with other database systems, causing confusion for 
readers who are not familiar with this aspect of Hive.  It also ties the 
optimizer's hands and eliminates many potential optimizations.

> Short-circuiting of the OR operator doesn't seem to be happening
> ----------------------------------------------------------------
>
>                 Key: HIVE-67
>                 URL: https://issues.apache.org/jira/browse/HIVE-67
>             Project: Hadoop Hive
>          Issue Type: Bug
>          Components: Query Processor
>            Reporter: Venky Iyer
>
> An example case is
> select t.date from t where t.date = '' or month(t.date) = '12'; 
> This still seems to be produce errors like 
> java.io.IOException: org.apache.hadoop.hive.ql.metadata.HiveException: Unable 
> to execute method public java.lang.Boolean 
> org.apache.hadoop.hive.ql.udf.UDFBaseCompare.evaluate(java.lang.Number,java.lang.String)
>   on object org.apache.hadoop.hive.ql.udf.udfopeq...@14e0e90 of class 
> org.apache.hadoop.hive.ql.udf.UDFOPEqual with arguments {null, 
> 05:java.lang.String} of size 2:null
>       at 
> org.apache.hadoop.hive.ql.exec.ExecReducer.reduce(ExecReducer.java:169)
>       at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:391)
>       at 
> org.apache.hadoop.mapred.TaskTracker$Child.main(TaskTracker.java:2139)
> Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: Unable to 
> execute method public java.lang.Boolean 
> org.apache.hadoop.hive.ql.udf.UDFBaseCompare.evaluate(java.lang.Number,java.lang.String)
>   on object org.apache.hadoop.hive.ql.udf.udfopeq...@14e0e90 of class 
> org.apache.hadoop.hive.ql.udf.UDFOPEqual with arguments {null, 
> 05:java.lang.String} of size 2:null
>       at 
> org.apache.hadoop.hive.ql.exec.FunctionRegistry.invoke(FunctionRegistry.java:394)
>       at 
> org.apache.hadoop.hive.ql.exec.ExprNodeFuncEvaluator.evaluate(ExprNodeFuncEvaluator.java:75)
>       at 
> org.apache.hadoop.hive.ql.exec.ExprNodeFuncEvaluator.evaluate(ExprNodeFuncEvaluator.java:72)
>       at 
> org.apache.hadoop.hive.ql.exec.ExprNodeFuncEvaluator.evaluate(ExprNodeFuncEvaluator.java:72)
>       at 
> org.apache.hadoop.hive.ql.exec.ExprNodeFuncEvaluator.evaluate(ExprNodeFuncEvaluator.java:72)
>       at 
> org.apache.hadoop.hive.ql.exec.FilterOperator.process(FilterOperator.java:62)
>       at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:260)
>       at 
> org.apache.hadoop.hive.ql.exec.JoinOperator.createForwardJoinObject(JoinOperator.java:257)
>       at 
> org.apache.hadoop.hive.ql.exec.JoinOperator.genObject(JoinOperator.java:477)
>       at 
> org.apache.hadoop.hive.ql.exec.JoinOperator.genObject(JoinOperator.java:467)
>       at 
> org.apache.hadoop.hive.ql.exec.JoinOperator.genObject(JoinOperator.java:467)
>       at 
> org.apache.hadoop.hive.ql.exec.JoinOperator.checkAndGenObject(JoinOperator.java:507)
>       at 
> org.apache.hadoop.hive.ql.exec.JoinOperator.endGroup(JoinOperator.java:489)
>       at 
> org.apache.hadoop.hive.ql.exec.ExecReducer.reduce(ExecReducer.java:140)
>       ... 2 more
> nulls are being produced in month(); 
> The month() function produces nulls when the string is ''; but those strings 
> should never be touched by month(). 
> ** note that this is a faked test case, come talk to me if you need a real 
> example.
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to