[ 
https://issues.apache.org/jira/browse/HIVE-1478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zoltan Haindrich updated HIVE-1478:
-----------------------------------
    Attachment: HIVE-1478.2.patch

patch#2)

removed qtest cases which contained invalid where expressions.

it turned out that there was a ticket to do support this conversion for 
vectorization(HIVE-13659)...not sure what to do now:

* close this as won't fix - and open an another issue that this fails for mr
* i've undone the {{VectorizationContext}} change of HIVE-13659 in this patch - 
as it will became an unreachable codepath after this change.

I think it would be better to stick to the standard...because casting anything 
into a boolean may help a bad query to hide in the woods ;)

[~ashutoshc],[~mmccline] what's your opinion?

> Non-boolean expression in WHERE should be rejected
> --------------------------------------------------
>
>                 Key: HIVE-1478
>                 URL: https://issues.apache.org/jira/browse/HIVE-1478
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 0.7.0
>            Reporter: Paul Yang
>            Assignee: Zoltan Haindrich
>            Priority: Minor
>         Attachments: HIVE-1478.1.patch, HIVE-1478.2.patch
>
>
> Automatically casting strings or other types into boolean may confuse even 
> the user - and somehow it doesn't always work (HIVE-15089)
> sql2011 states that "where expression" should accept a boolean expression.
> Original reported problem:
> If the expression in the where clause does not evaluate to a boolean, the job 
> will fail with the following exception in the task logs:
> Query:
> SELECT key FROM src WHERE 1;
> Exception in mapper:
> 2010-07-21 17:00:31,460 FATAL ExecMapper: 
> org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while 
> processing row {"key":"238","value":"val_238"}
>       at 
> org.apache.hadoop.hive.ql.exec.MapOperator.process(MapOperator.java:417)
>       at org.apache.hadoop.hive.ql.exec.ExecMapper.map(ExecMapper.java:180)
>       at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50)
>       at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:358)
>       at org.apache.hadoop.mapred.MapTask.run(MapTask.java:307)
>       at org.apache.hadoop.mapred.Child.main(Child.java:159)
> Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to 
> java.lang.Boolean
>       at 
> org.apache.hadoop.hive.ql.exec.FilterOperator.processOp(FilterOperator.java:84)
>       at org.apache.hadoop.hive.ql.exec.Operator.process(Operator.java:457)
>       at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:697)
>       at 
> org.apache.hadoop.hive.ql.exec.TableScanOperator.processOp(TableScanOperator.java:45)
>       at org.apache.hadoop.hive.ql.exec.Operator.process(Operator.java:457)
>       at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:697)
>       at 
> org.apache.hadoop.hive.ql.exec.MapOperator.process(MapOperator.java:400)
>       ... 5 more



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to