json 表
hive> create table testHive(name string, age int) row format serde 'org.apache.hive.hcatalog.data.JsonSerDe';
OK
Time taken: 0.74 seconds
hive> show tables;
OK
testhive
Time taken: 0.042 seconds, Fetched: 1 row(s)
hive> load data inpath '/testdata.txt' into table testhive;
Loading data to table default.testhive
OK
Time taken: 2.132 seconds
hive> select * from testhive;
OK
张三 17
李四 18
王五 16
Time taken: 1.293 seconds, Fetched: 3 row(s)
执行 select count
报:Class org.apache.hive.hcatalog.data.JsonSerDe not found
在 hive
创建 auxlib
,添加 hive-hcatalog-core-2.3.2.jar
到这个目录中