不匹配的输入“>”在结构类型中期望 < 靠近“STRUCT”
Posted
技术标签:
【中文标题】不匹配的输入“>”在结构类型中期望 < 靠近“STRUCT”【英文标题】:mismatched input '>' expecting < near 'STRUCT' in struct type 【发布时间】:2017-02-20 13:39:30 【问题描述】:FAILED: ParseException line 1:161 mismatched input '>' 期望 CREATE EXTERNAL TABLE user1 (id BIGINT, created_at STRING, source STRING, favorited BOOLEAN, retweet_count INT, retweeted_status STRUCTsreen_name:STRING,name:STRING>>, 实体 STRUCT , user_mentions:ARRAY>, hashtags:ARRAY>>,text STRING, user STRUCT, in_reply_to_screen_name STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY ",";
请问我该如何解决这个问题?
【问题讨论】:
【参考方案1】:CREATE EXTERNAL TABLE user1
(
id BIGINT
,created_at STRING
,source STRING
,favorited BOOLEAN
,retweet_count INT
,retweeted_status STRUCT
<
text:STRING
,user:STRUCT
<
sreen_name :STRING
,name :STRING
>
>
,entities STRUCT
<
urls :ARRAY<STRING>
,user_mentions :ARRAY<STRING>
,hashtags :ARRAY<STRING>
>
,text STRING
,user STRING
,in_reply_to_screen_name STRING
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ","
;
【讨论】:
数组和结构应该有类型定义Array/Struct <definition>
以上是关于不匹配的输入“>”在结构类型中期望 < 靠近“STRUCT”的主要内容,如果未能解决你的问题,请参考以下文章
Facebook JS SDK 的 FB.api('/me') 方法不返回我在 Graph API v2.4+ 中期望的字段
python基于tpot训练模型机器学习模型并指定在模型训练过程中期望使用的学习器列表