hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Gates <alanfga...@gmail.com>
Subject Re: Stroing boolean value in Hive table
Date Thu, 18 Feb 2016 16:56:15 GMT
How the data is stored is up to the storage format (text, rcfile, orc, etc.).  Do you mean
in your text file you’d like booleans stored as 0 or 1?  You could use the case statement
to convert them to integers like:

select case _boolvar_ when true then 1 when false then 0 end from …

Alan.

> On Feb 18, 2016, at 04:18, mahender bigdata <Mahender.BigData@outlook.com> wrote:
> 
> Hi,
> 
> How can we store Boolean value with 1 or 0 instead of storing true or false string. we
can make use of CAST function to convert boolean into 1 or 0. Is there any built-in setting
in hive, which enable and store hive Boolean column values in 0 or 1 instead of true and false.
> 
> 
> 


Mime
View raw message