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.vasude...@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.

Reply via email to