创建hive表时出现以下异常。任何人都可以指出错误吗? 示例输入:{“user”:{“userlocation”:“Bolton,UK”,“id”:14141159,“name”:“Chris Beckett”,“screenname”:“ChrisBeckett”,“geoenabled”:true},“ tweetmessage“:”vCOps人 - 高级版= = 5个虚拟机吗?我知道Std有UI和分析虚拟机,但其余用途是什么?Hyperic等?#vmware #vcops“,”createddate“:”2013-06-20T12: 8时46" 分, “地理位置”:空}
enter code here
CREATE EXTERNAL TABLE IF NOT EXISTS twitter(
users map<string,string,string,string,string>,
message string,
createddate string,
geolocation string
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.JsonSerde'
LOCATION ' /user/root/hadoop_tests/sample_twitter_data.txt';
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
失败:ParseException行2:23缺失&gt;在','在列类型中'string'附近 第2:30行无法识别列类型
中',''string'','附近的输入答案 0 :(得分:0)
也许你应该使用Struct而不是Map.Below:
CREATE EXTERNAL TABLE IF NOT EXISTS twitter(
users struct<userlocation:string,id:string,name:string,screenname:string,geoenabled:string>,
message string,
createddate string,
geolocation string
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.JsonSerde'
LOCATION '/user/root/hadoop_tests/';