I have a HIVE table which will hold billions of records, its a time-series data so the partition is per minute. Per minute we will have around 1 million records.
I have few fields in my table, VIN number (17 chars), Status (2 chars) ... etc
So my question is during the table creation if I choose to use Varchar(X) vs String, is there any storage or performance problem,
Few limitation of varchar are https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types#LanguageManualTypes-string
If we provide more than "x" characters it will silently truncate, so keeping it string will be future proof.
Non-generic UDFs cannot directly use varchar type as input arguments or return values. String UDFs can be created instead, and the varchar values will be converted to strings and passed to the UDF. To use varchar arguments directly or to return varchar values, create a GenericUDF.
There may be other contexts which do not support varchar, if they rely on reflection-based methods for retrieving type information. This includes some SerDe implementations.
What is the cost I have to pay for using string instead of varchar in terms of storage and performance