0
votes

FAILED: ParseException line 1:161 mismatched input '>' expecting < near 'STRUCT' in struct type hive> 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>, user_mentions:ARRAY>, hashtags:ARRAY>>,text STRING, user STRUCT, in_reply_to_screen_name STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY ",";

How do I solve this problem please?

1

1 Answers

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