hive json serde

hive从0.12版本之后自带json序列化反序列化类,以前版本需要自己实现。

https://cwiki.apache.org/confluence/display/Hive/Json+SerDe

Json SerDe

Skip to end of metadata
Go to start of metadata

Availability

The JsonSerDe for JSON files is available in Hive 0.12 and later.

Background

The JsonSerDe was moved to Hive from HCatalog and before it was in hive-contrib project. It was added to the Hive distribution by HIVE-4895.

Usage

To use the SerDe, specify the fully qualified class name org.apache.hive.hcatalog.data.JsonSerDe, for example:

Create table, specify CSV properties
CREATE  TABLE  my_table(a string, b  bigint , ...)
ROW FORMAT SERDE  'org.apache.hive.hcatalog.data.JsonSerDe'
STORED  AS  TEXTFILE;

Depending on the distribution you might need to add hive-hcatalog-core.jar:

ADD JAR /usr/lib/hive-hcatalog/lib/hive-hcatalog-core.jar;

For general information about SerDes, see Hive SerDe in the Developer Guide. Also see SerDe for details about input and output processing.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值