hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Tromans <philip.j.trom...@gmail.com>
Subject Inconsistencies around casting booleans
Date Thu, 09 Aug 2012 08:52:04 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?

Cheers,

Phil.

Mime
View raw message