I have a table
created using HIVE query in Cloudera VM, below is my DDL
to create the table called incremental_tweets
.
CREATE EXTERNAL TABLE incremental_tweets (
id BIGINT,
created_at STRING,
source STRING,
favorited BOOLEAN,
retweet_count INT,
retweeted_status STRUCT<
text:STRING,
user:STRUCT<screen_name:STRING,name:STRING>>,
entities STRUCT<
urls:ARRAY<STRUCT<expanded_url:STRING>>,
user_mentions:ARRAY<STRUCT<screen_name:STRING,name:STRING>>,
hashtags:ARRAY<STRUCT<text:STRING>>>,
text STRING,
user STRUCT<
screen_name:STRING,
name:STRING,
friends_count:INT,
followers_count:INT,
statuses_count:INT,
verified:BOOLEAN,
utc_offset:INT,
time_zone:STRING>,
in_reply_to_screen_name STRING
)
ROW FORMAT SERDE 'com.cloudera.hive.serde.JSONSerDe'
LOCATION '/twitteranalytics/incremental/';
Upon executing this on the HUE HIVE Editor
the table gets created successfully, Now the issue is I am not able to execute SELECT
statement which throws the following error.
SELECT Statement
Select id, entities.user_mentions.name FROM incremental_tweets;
ERROR
Error while processing statement: FAILED: Execution Error, return code 2
from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
Also, since HUE editor
gives auto complete feature, below was the statement and the error it gave.
Statement
Select id, entities.`,user_mentions`.name FROM incremental_tweets;
ERROR
Error while compiling statement: FAILED: RuntimeException cannot find field
,user_mentions(lowercase form: ,user_mentions) in [urls, user_mentions,
hashtags]
What is correct SELECT statement
? Am I missing out any syntax?