0
votes

When we create an ORC table in hive we can see that the data is compressed and not exactly readable in HDFS. So how is Hive able to convert that compressed data into readable format which is shown to us when we fire a simple select * query to that table?

Thanks for suggestions!!

2

2 Answers

0
votes

By using ORCserde while creating table. u have to provide package name for serde class. ROW FORMAT ''. What serde does is to serialize a particular format data into object which hive can process and then deserialize to store it back in hdfs.

0
votes

Hive uses “Serde” (Serialization DeSerialization) to do that. When you create a table you mention the file format ex: in your case It’s ORC “STORED AS ORC” , right. Hive uses the ORC library(Jar file) internally to convert into a readable format. To know more about hive internals search for “Hive Serde” and you will know how the data is converted to object and vice-versa.