Insome distributions, a reference to hive-hcatalog-core.jar is required.ADD JAR /usr/lib/hive-hcatalog/lib/hive-hcatalog-core.jar;
从Hive 0.12版本开始
CREATETABLE my_table(a string, b int)ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'
STORED AS TEXTFILE;
Hive 3.0.0新的JsonSerDe,原来的JsonSerDe也可以用
CREATETABLE my_table(a string, b int)ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.JsonSerDe'
STORED AS TEXTFILE;
Hive 4.0.0才支持JSONFILE
STORED AS JSONFILE
CSV/TSV格式
-- 所有的字段必须是string类型CREATETABLE my_table(a string, b string)ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'WITH SERDEPROPERTIES ("separatorChar"="\t","quoteChar"="'","escapeChar"="\\")
STORED AS TEXTFILE;