如何使用serde创建一个表,其中文本文件具有固定宽度(非分隔)列?

0g0grzrc  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(345)

我正在尝试创建一个包含不带分隔符的文本文件的表。
行示例:
1000000000168999337200

qvsjd97n

qvsjd97n1#

030420191455594197981209954------- 00000240000005010000000011800000000000

CREATE EXTERNAL TABLE IF NOT EXISTS p_bi.stg_cob (tp_registro string, seq string, num_a string, dt_chamada string, hr_chamada string, num_b string, pt_interconect string, dur_rel_chamada string, dur_tar_chamada string, tp_servico string, vl_liq_chamada string, vl_brt_chamada string, reserva string) ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe' WITH SERDEPROPERTIES ("input.regex" = "(.{1})(.{10})(.{21})(.{8})(.{6})(.{20})(.{10})(.{7})(.{7})(.{2})(.{11})(.{11})(.{29}).*") STORED AS TEXTFILE LOCATION '/user/Fin/Bat';

相关问题