‘hdfs://CMBHHA/apps/hive/datahouse/test/table_tset’
### 4、几经搜索,问题终于解决,附上完整示例
#### 4.1、找到和hive版本对应的hive-contrib包,下载jar上传到hdfs上
[org/apache/hive/hive-contrib所有版本Jar文件及下载 -时代Java]( )
[hive-contrib包下载链接]( )
#### 4.2、以三个等号作为列分隔符 构建hive表的完整demo
add jar hdfs://team/work/libs/xxx/hive-contrib-2.0.1.jar;
drop table if exists mb_tmp.yz_1013;
create table if not exists mb_tmp.yz_1013(
test_id int,
work_place string,
other string
)
partitioned by(dt string)
ROW FORMAT SERDE ‘org.apache.hadoop.hive.contrib.serde2.MultiDelimitSerDe’ WITH SERDEPROPERTIES (“field.delim”=“===”)
load data local inpath ‘/data/home/xxxx/client/ct_data_1010.txt’ overwrite into table mb_tmp.yz_1013 partition(dt=‘2022-10-10’);
其中 以三个等号分割进行作为列分割的数据如下:
[work@xxxx client]$ cat ct_data_1010.txt
10011=beijing=chushi
10012=tianjin=changchun
10013=zhengzhou=siji
100014=zhangda=job
#### 4.3、结果验证
hive> desc mb_tmp.yz_1013;
OK
test_id int from deserializer
work_place string from deserializer
other string from deserializer
dt string
Partition Information
col_name data_type comment
dt string
Time taken: 0.332 seconds, Fetched: 9 row(s)
hive> set hive.cli.print.header=true;
hive> select * from mb_tmp.yz_1013 limit 100;
OK
yz_1013.test_id yz_1013.work_place yz_1013