Hive SERDE

Hive SERDE

SERDE is a combination of Serializer and Deserializer i.e SERIALIZER + DESERIALIZER = SERDE. SERDE is popularly used to load from sources storing data in JSON format.


SERDE Table Example: Below example is the table where JSON data will be loaded

Common Error: Data load to the table containing numeric datatype will fail with below error if number field in JSON is defined as string (within double quote).

Failed with exception java.io.IOException:org.apache.hadoop.hive.serde2.SerDeException: org.codehaus.jackson.JsonParseException: Current token (VALUE_STRING) not numeric, can not use numeric value accessors

For example: Note the difference between below 2 JSONs messages for cust_id values.

SERDE Table Example(Numeric Data): Below example is the table where JSON data(contain numeric data) will be loaded