You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Gayathri Swaroop <g3...@gmail.com> on 2014/12/15 18:47:04 UTC

Question on varchar in 0.12.0 version of nive

I am a newbie to hive. I am trying to query an oracle table in hive. The
data is in hadoop and i have created similar varchar columns in my external
table. Would like to know what are the limitations of varchar over string.
And why people prefer string over varchar.

Thanks,
Gayathri

Re: Question on varchar in 0.12.0 version of nive

Posted by Jason Dere <jd...@hortonworks.com>.
Varchar was only added to Hive in 0.12, before that there was only string if you wanted to deal with string types. Varchar will enforce the max character length, truncating the string value if necessary. We've tried to make it as compatible with string as possible.
One thing about varchars, if you are writing custom Hive UDFs, if you want to return varchar values you will need to use the newer style GenericUDF class, rather than the older style UDF class. If you use the older style UDF, you would simply have to use String type when handling string data in the UDF. Varchar values are automatically converted to string type in this case.


On Dec 15, 2014, at 9:47 AM, Gayathri Swaroop <g3...@gmail.com> wrote:

> I am a newbie to hive. I am trying to query an oracle table in hive. The data is in hadoop and i have created similar varchar columns in my external table. Would like to know what are the limitations of varchar over string. And why people prefer string over varchar.
> 
> Thanks,
> Gayathri


-- 
CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to 
which it is addressed and may contain information that is confidential, 
privileged and exempt from disclosure under applicable law. If the reader 
of this message is not the intended recipient, you are hereby notified that 
any printing, copying, dissemination, distribution, disclosure or 
forwarding of this communication is strictly prohibited. If you have 
received this communication in error, please contact the sender immediately 
and delete it from your system. Thank You.

Re: Question on varchar in 0.12.0 version of nive

Posted by Gayathri Swaroop <g3...@gmail.com>.
>
> I am a newbie to hive. I am trying to query an oracle table in hive. The
> data is in hadoop and i have created similar varchar columns in my external
> table. Would like to know what are the limitations of varchar over string.
> And why people prefer string over varchar.
>
> Thanks,
> Gayathri
>