我正在尝试分析Twitter数据。 当我尝试使用以下命令创建表时:
hive> CREATE external TABLE tweets (
retweeted boolean,
createpapa string,
place string,
text string,
retweeted_status
STRUCT<text:STRING,user:STRUCT<screen_name:STRING,name:STRING>,retweet_count:INT>,
created_at string,
place string,
text string,
entitles STRUCT<urls:ARRAY<STRUCT<expanded_url:STRING>>,user_mentions:ARRAY<STRUCT<screen_name:STRING,name:STRING>>,hashtags:ARRAY<STRUCT<text:STRING>>>,
source string,
retweet_count int,
user STRUCT<locations:string,`following`:string,protected:boolean,verified:boolean,description:string,name:string,created_at:string,followers_count:int,url:string,friends_count:int,screen_name:string>)
ROW FORMAT SERDE 'com.cloudera.hive.serde.JSONSerDe'
LOCATION '/sparkEcosystem';
我收到以下错误:
FAILED: SemanticException [Error 10036]: Duplicate column name: place
任何人都可以帮助我吗?
答案 0 :(得分:2)
你写了两次“地方字符串”。删除其中一个并再次运行。
CREATE external TABLE tweets (retweeted boolean,createpapa string,text string,retweeted_status STRUCT,retweet_count:INT>,created_at string,place string,text string,entitles STRUCT>,user_mentions:ARRAY>,hashtags:ARRAY>>,source string,retweet_count int,user STRUCT)ROW FORMAT SERDE 'com.cloudera.hive.serde.JSONSerDe'LOCATION '/sparkEcosystem';