Similar to Java, Hive supports both implicit type conversion and explicit type conversion.
Primitive type conversion from a narrow to a wider type is known as implicit conversion. However, the reverse conversion is not allowed. All the integral numeric types,
STRING can be implicitly converted to
INT can all be converted to
BOOLEAN types cannot be converted to any other type. In the Apache Hive wiki, there is a data type cross table describing the allowed implicit conversion between every two types in Hive and this can be found at https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types.
Explicit type conversion is using the
CAST function with the