配置单元创建表重复列名错误

owfi6suc  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(449)

我正在分析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

有人能帮我吗?

knpiaxh1

knpiaxh11#

你写了两次“place string”。移除其中一个并再次运行。 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';

相关问题