Using string data types
Hive supports three types of String data type, STRING, VARCHAR, and CHAR:
STRING: It is a sequence of characters that can be expressed using single quotes (
') as well as double quotes (").VARCHAR: It is variable-length character type. It is defined using a length specifier, which specifies the maximum number of characters allowed in the character string. Its syntax is
VARCHAR(max_length). The value of thevarchardata type gets truncated during processing if necessary to fit within the specified length. While converting the string value to thevarcharvalue, if a string value exceeds the length specifier, then the string gets silently truncated. The maximum length ofvarchartype is65355.CHAR: It is fixed-length character type. It is defined in the same way as the
varchartype. If the value is shorter as compared with the specified length, then the value is padded with trailing spaces to achieve the specified length. The maximum length of thechartype is 255.