我有以下查询:
Select * from MyNode
如何处理spark中哪一列是MAP以获取Key及其值?
Hive Table Schema
CREATE EXTERNAL TABLE IF NOT EXISTS MyNode
(
Name STRING,
CommandText MAP <TINYINT, STRING> ,
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '|'
COLLECTION ITEMS TERMINATED BY ','
MAP KEYS TERMINATED BY ':'
LINES TERMINATED BY '\n'
STORED AS TEXTFILE
LOCATION '/user/hive/warehouse/MyNode'
1行数据
MYNODENAME|{1:"echo",2:"mkdir",3:"cp"}
提前致谢。