不匹配的输入'''期待<靠近' STRUCT'在struct类型中

时间:2017-02-20 13:39:31

标签: hive hiveql create-table

  

失败:ParseException第1行:161输入不匹配'>'期待<靠近' STRUCT'在struct类型中   蜂房> CREATE EXTERNAL TABLE user1(id BIGINT,created_at STRING,source STRING,favited BOOLEAN,retweet_count INT,retweeted_status STRUCT< text:STRING,user:STRUCT> sreen_name:STRING,name:STRING>&gt ;,实体STRUCT< urls:ARRAY>, user_mentions:ARRAY>,hashtags:ARRAY>&gt ;, text STRING,user STRUCT,in_reply_to_screen_name STRING)行格式删除字段终止于",";

我该如何解决这个问题?

1 个答案:

答案 0 :(得分: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 ","
;