stackoverflow is your friend.
that said have a peek at the doc even :) cf. https://cwiki.apache.org/
confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-Keywords,Non-
reservedKeywordsandReservedKeywords paying close attention to this
paragraph:
{quote}
Reserved keywords are permitted as identifiers if you quote them as
described in Supporting Quoted Identifiers in Column Names
<https://issues.apache.org/jira/secure/attachment/12618321/QuotedIdentifier.html>
(version 0.13.0 and later, see HIVE-6013
<https://issues.apache.org/jira/browse/HIVE-6013>). Most of the keywords
are reserved through HIVE-6617
<https://issues.apache.org/jira/browse/HIVE-6617> in order to reduce the
ambiguity in grammar (version 1.2.0 and later). There are two ways if the
user still would like to use those reserved keywords as identifiers: (1)
use quoted identifiers, (2) set hive.support.sql11.reserved.keywords
<https://cwiki.apache.org/confluence/display/Hive/Configuration+Properties#ConfigurationProperties-hive.support.sql11.reserved.keywords>=false.
{quote}
On Tue, Aug 16, 2016 at 3:23 PM, Igor Kravzov <[email protected]>
wrote:
> Hi,
>
> I am storing tweets in HDFS and creating external table on top of these
> tweets..
> The command I am using is bellow:
>
> *create external table tweets (*
> * id bigint,*
> * in_reply_to_screen_name string,*
> * in_reply_to_status_id bigint,*
> * user struct<*
> * id: bigint, *
> * name: string,*
> * screen_name: string>,*
> * retweeted_status struct <*
> * id:bigint>,*
> * text string*
> * )*
> *partitioned by (yyyymmdd int)*
> *ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'*
> *location 'my location';*
>
> But I am getting the following error:
>
> org.apache.ambari.view.hive.client.HiveInvalidQueryException: Error while
> compiling statement: FAILED: ParseException line 5:2 Failed to recognize
> predicate 'user'. Failed rule: 'identifier' in column specification
> [ERROR_STATUS]
>
> Without "user" definition" query runs fine.
>
> Can it be because 'user' is reserved keyword? Or there is something else?
> "user" as part of tweet structure. How can I name column differently?
>
> Thank in advance.
>