Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

hive in ambari KW_ROLE error

avatar
Expert Contributor

From this Hive script (submitted in Ambari 2.2.1.0):

set hive.execution.engine=tez;
SET hive.support.sql11.reserved.keywords=false;
create table tweets (
  contributors string,
  coordinates string,
  created_at string,
  entities struct <
    hashtags: array <string>,
    symbols: array <string>,
    urls: array <struct <
        display_url: string,
        expanded_url: string,
        indices: array <tinyint>,
        url: string>>,
    user_mentions: array <string>>,
  favorite_count tinyint,
  favorited boolean,
  filter_level string,
  geo string,
  id bigint,
  id_str binary,
  in_reply_to_screen_name string,
  in_reply_to_status_id string,
  in_reply_to_status_id_str string,
  in_reply_to_user_id string,
  in_reply_to_user_id_str string,
  is_quote_status boolean,
  lang string,
  place string,
  possibly_sensitive boolean,
  retweet_count tinyint,
  retweeted boolean,
  source string,
  text string,
  timestamp_ms string,
  truncated boolean,
  user struct <
    contributors_enabled: boolean,
    created_at: string,
    default_profile: boolean,
    default_profile_image: boolean,
    description: string,
    favourites_count: tinyint,
    follow_request_sent: string,
    followers_count: tinyint,
    following: string,
    friends_count: tinyint,
    geo_enabled: boolean,
    id: bigint,
    id_str: binary,
    is_translator: boolean,
    lang: string,
    listed_count: tinyint,
    location: string,
    name: string,
    notifications: string,
    profile_background_color: binary,
    profile_background_image_url: string,
    profile_background_image_url_https: string,
    profile_background_tile: boolean,
    profile_image_url: string,
    profile_image_url_https: string,
    profile_link_color: binary,
    profile_sidebar_border_color: binary,
    profile_sidebar_fill_color: binary,
    profile_text_color: binary,
    profile_use_background_image: boolean,
    protected: boolean,
    screen_name: string,
    statuses_count: smallint,
    time_zone: string,
    url: string,
    utc_offset: string,
    verified: boolean>
)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
AS ORC tblproperties ("orc.compress"="ZLIB");

LOAD DATA LOCAL INPATH '/home/ed/Downloads/hive-json-master/1abbo.txt' OVERWRITE INTO TABLE tweets;

SELECT COUNT(*) from tweets;

I am getting:

 Error while compiling statement: FAILED: ParseException line 4:4 missing KW_ROLE at 'hive' near 'hive' line 4:8 missing EOF at '.' near 'hive' [ERROR_STATUS]

I use Hdp 2.4.2.0-258.

I found the following but don't know if it any help in fixing this. Any help is much appreciated:

https://www.mail-archive.com/[email protected]/msg00327.html

1 ACCEPTED SOLUTION

avatar
Expert Contributor

User and following needed to be enclosed in backticks and the keyword STORED was missing.

View solution in original post

1 REPLY 1

avatar
Expert Contributor

User and following needed to be enclosed in backticks and the keyword STORED was missing.