You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Raghotham Murthy (JIRA)" <ji...@apache.org> on 2008/12/24 09:18:44 UTC

[jira] Commented: (HIVE-197) UDFToBoolean flipping values

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

Raghotham Murthy commented on HIVE-197:
---------------------------------------

looks good.

+1

Btw do we want to support casting any random string to boolean? Mysql seems to just convert the string to an integer and return false only if the integer is 0, else true.
But its not consistent.

For example: SELECT IF("10", TRUE, FALSE) returns 1 but SELECT "10" = TRUE; returns 0.




> UDFToBoolean flipping values
> ----------------------------
>
>                 Key: HIVE-197
>                 URL: https://issues.apache.org/jira/browse/HIVE-197
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Raghotham Murthy
>            Assignee: Zheng Shao
>             Fix For: 0.2.0
>
>         Attachments: HIVE-197-1.patch
>
>
> UDFToBoolean should do
> return Boolean.valueOf(i.byteValue() != 0)
> Instead of
> return Boolean.valueOf(i.byteValue() == 0)
> Same for all other types.

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