hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Tromans <>
Subject Inconsistencies around casting booleans
Date Thu, 09 Aug 2012 09:14:24 GMT
Hi all,

We've been using boolean types in partition values (not the best idea,
I know), and we've noticed a few inconsistencies around casting:

SELECT cast('true' as boolean), cast('false' as boolean), cast(true as
string), cast(false as string), cast(cast(false as string) as boolean)
FROM test


true    true    TRUE    FALSE   true

The current logic in UDFToBoolean is that a string is false if it's
empty, and true otherwise. This isn't mirrored in UDFToString(), and
hence the inconsistency above.

I'm happy to file a JIRA to change this to something more reasonable,
but I guess this would break backwards compatibility. What are
people's opinions on this?



View raw message