输入文件:
[Tom,123,0,jump]
[jerry,345,1,run]
我想在hive中阅读上面的输入, 我的ddl是
创建外部表,如果不存在db1.tomjerrry (name string,id int,isGood int,activity string)
行格式分隔的字段由','
终止LOCATION' /user/myname/sample.txt'
当我尝试阅读时, 从db1.tomjerrry
中选择名称我明白了,
[汤姆
[杰里
如何删除配置单元输出中的方括号。?
答案 0 :(得分:0)
添加ESCAPED BY' ['
即
CREATE EXTERNAL TABLE IF NOT EXISTS db1.tomjerrry ( name ARRAY<string>, id int, isGood int, activity string )
row format delimited fields terminated by ',' ESCAPED BY '[';
LOCATION '/user/myname/sample.txt'
或更新CSV文件删除[。