问题遇到的现象和发生背景
hive数据表array类型列导入数据为空
问题相关代码,请勿粘贴截图
我的建表语句:
CREATE TABLE IF NOT EXISTS
hive_database.managed_table(
staff_id INT COMMENT "This is staffid",
staff_name STRING COMMENT "This is staffname",
salary FLOAT COMMENT "This is staff salary",
hobby ARRAY<STRING> COMMENT "This is staff hobby",
deductions MAP<STRING, FLOAT> COMMENT "This is staff deduction",
address STRUCT<street:STRING,city:STRING> COMMENT "This is staff address")
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
COLLECTION ITEMS TERMINATED BY '_'
MAP KEYS TERMINATED BY ':'
LINES TERMINATED BY '\n'
STORED AS textfile
TBLPROPERTIES("comment"="This is a managed table");
导入数据:
001,xiaoming,8000,music_game,late:100_unpaidleave:500,hui long guan_beijing
002,xiaohong,9000,run_gourmet,late:50_unpaidleave:0,xi er qi_beijing
003,zhangsan,10000,swim_basketball_travel,late:0_unpaidleave:300,yong feng_beijing
运行结果及报错内容
我的解答思路和尝试过的方法
我用 select array(‘music’,‘game’) 测试过,发现结果为空。
我想要达到的结果
为什么插入为空呢?