不匹配的输入'>'在结构类型中的'struct'附近应为<

23c0lvtd  于 2021-06-26  发布在  Hive
关注(0)|答案(1)|浏览(264)

失败:parseexception行1:161不匹配的输入'>',在struct type hive>create external table user1(id bigint,created \u at string,source string,favorited boolean,retweet \u count int,retweeted \u status struct)中预期<near'struct'text:string, user:struct>斯雷恩_name:string,name:string>>,实体结构urls:array>,用户_mentions:array>, hashtags:array>>,文本字符串,用户结构,in\ reply\ to\ screen\ name string)行格式分隔字段,以“,”结尾;
请问我该如何解决这个问题?

pexxcrt2

pexxcrt21#

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 ","
;

相关问题