数据文件内容

id=123,name=steven
id=55,name=ray

期望输出格式

123    steven
55      ray

 

1. 创建表, 用正则表达式的形式指定格式

create table test1(id int, name string) row format serde 'org.apache.hadoop.hive.serde2.RegexSerDe' with serdeproperties ("input.regex" = "id=(.*),name=(.*)") stored as textfile;

 

2. 加载数据

load data local inpath '/home/stevenxia/桌面/hello4' overwrite into table test1;

3. 查询结果

HIVE: SerDe应用实例

 

相关文章:

  • 2021-09-12
  • 2022-12-23
  • 2021-08-05
  • 2022-12-23
  • 2022-12-23
  • 2022-02-14
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-09
  • 2021-10-14
  • 2022-12-23
  • 2021-05-16
  • 2021-10-02
  • 2021-05-28
相关资源
相似解决方案