Support Questions

Find answers, ask questions, and share your expertise

hive in ambari KW_ROLE error

Expert Contributor

From this Hive script (submitted in Ambari

set hive.execution.engine=tez;
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>
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

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


Expert Contributor

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

View solution in original post


Expert Contributor

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

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.