Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use InputFormat, OutputFormat and SerDe in Hive

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to use InputFormat, OutputFormat and SerDe in Hive. It is very detailed and has a certain reference value. Friends who are interested must finish it!

In Hive, TextInputFormat is used by default, and one line represents a record. In each record (in a row), the fields are split using ^ A by default.

In some cases, we are often faced with multi-line, structured documents and need to import them into Hive for processing, at this point, we need to customize InputFormat, OutputFormat, and SerDe.

First of all, to sort out the relationship between the three, let's directly quote the official saying of Hive:

SerDe is a short name for "Serializer and Deserializer." Hive uses SerDe (and! FileFormat) to read and write table rows.HDFS files-> InputFileFormat (RecordReader)->-> Deserializer-> Row objectRow object-> Serializer-> OutputFileFormat (recordwriter)-> HDFS files

To sum up, when faced with a file on HDFS, Hive will do the following (take reading as an example):

(1) call InputFormat to cut the file into different documents. Each document is one line (Row).

(2) call the Deserializer of SerDe to Row a line into fields.

When HIVE performs INSERT operation and writes Row to a file, the Seriliazer of OutputFormat and SerDe is mainly called, in reverse order.

The above is all the contents of the article "how to use InputFormat, OutputFormat and SerDe in Hive". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report