How-to: Use a SerDe in Apache Hive by Jonathan Natkins.
From the post:
Apache Hive is a fantastic tool for performing SQL-style queries across data that is often not appropriate for a relational database. For example, semistructured and unstructured data can be queried gracefully via Hive, due to two core features: The first is Hive’s support of complex data types, such as structs, arrays, and unions, in addition to many of the common data types found in most relational databases. The second feature is the SerDe.
What is a SerDe?
The SerDe interface allows you to instruct Hive as to how a record should be processed. A SerDe is a combination of a Serializer and a Deserializer (hence, Ser-De). The Deserializer interface takes a string or binary representation of a record, and translates it into a Java object that Hive can manipulate. The Serializer, however, will take a Java object that Hive has been working with, and turn it into something that Hive can write to HDFS or another supported system. Commonly, Deserializers are used at query time to execute
SELECT
statements, and Serializers are used when writing data, such as through anINSERT-SELECT
statement.In this article, we will examine a SerDe for processing JSON data, which can be used to transform a JSON record into something that Hive can process.
You may be too busy to notice if you have any presents under the tree. 😉