配置单元创建 table 重复列名错误
hive creating table duplicate column name error
我正在尝试分析 Twitter 数据。
当我尝试使用以下命令创建 table 时:
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
谁能帮帮我?
您写了 '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';
我正在尝试分析 Twitter 数据。 当我尝试使用以下命令创建 table 时:
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
谁能帮帮我?
您写了 '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';