[ https://issues.apache.org/jira/browse/HIVE-1703?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Xuefu Zhang reassigned HIVE-1703: --------------------------------- Assignee: Xuefu Zhang > BOOL types should implicitly cast to INT > ---------------------------------------- > > Key: HIVE-1703 > URL: https://issues.apache.org/jira/browse/HIVE-1703 > Project: Hive > Issue Type: Improvement > Components: Query Processor > Reporter: Adam Kramer > Assignee: Xuefu Zhang > Priority: Minor > > From the Wiki: > "Otherwise, the operator is probably a UDF/UDAF function. In that case, we > will try to convert the parameters to the types that are accepted by the > UDF/UDAF function. If the UDF/UDAF function is overloaded (with more than 1 > implementations with different types), we will try to find the one with least > number of type conversions needed." > However, > SELECT SUM(thing=otherthing) FROM table > ...fails, because thing=otherthing is a bool, and there is no system by which > BOOL would convert to INT, as it should. INT is higher precision, so this > should always work. Explicit casting, SUM(CAST(thing=otherthing AS INT)) > works just fine. > (yes, in this simple case COUNT(1) WHERE thing=otherthing would do the job, > but it serves to illustrate the bug.) -- This message was sent by Atlassian JIRA (v6.1#6144)