Grokbase Groups Hive user March 2009
FAQ
I am not sure if this is a bug or just undocumented as a reserved keyword
(or I missed it) but in case people don't know, apparently you cannot call a
field "timestamp":

hive> CREATE EXTERNAL TABLE page_views(project_code STRING, page STRING,
referrer STRING, ip INT, timestamp INT) ROW FORMAT DELIMITED FIELDS
TERMINATED BY '\001' LINES TERMINATED BY '\012' STORED AS TEXTFILE LOCATION
'/user/hadoop/data/logging/page_views';
FAILED: Parse Error: line 2:7 mismatched input 'EXTERNAL' expecting
TEMPORARY in create function statement

Time taken: 0.131 seconds
hive> CREATE EXTERNAL TABLE page_views(project_code STRING, page STRING,
referrer STRING, ip INT, created INT) ROW FORMAT DELIMITED FIELDS TERMINATED
BY '\001' LINES TERMINATED BY '\012' STORED AS TEXTFILE LOCATION
'/user/hadoop/data/logging/page_views';
OK
Time taken: 0.063 seconds

Suhail

Search Discussions

  • Zheng Shao at Mar 22, 2009 at 11:02 pm
    HI Suhail,

    Please use `timestamp` as field name instead. Use backquota to escape the
    field name when needed.


    Zheng
    On Sun, Mar 22, 2009 at 3:47 PM, Suhail Doshi wrote:

    I am not sure if this is a bug or just undocumented as a reserved keyword
    (or I missed it) but in case people don't know, apparently you cannot call a
    field "timestamp":

    hive> CREATE EXTERNAL TABLE page_views(project_code STRING, page STRING,
    referrer STRING, ip INT, timestamp INT) ROW FORMAT DELIMITED FIELDS
    TERMINATED BY '\001' LINES TERMINATED BY '\012' STORED AS TEXTFILE LOCATION
    '/user/hadoop/data/logging/page_views';
    FAILED: Parse Error: line 2:7 mismatched input 'EXTERNAL' expecting
    TEMPORARY in create function statement

    Time taken: 0.131 seconds
    hive> CREATE EXTERNAL TABLE page_views(project_code STRING, page STRING,
    referrer STRING, ip INT, created INT) ROW FORMAT DELIMITED FIELDS TERMINATED
    BY '\001' LINES TERMINATED BY '\012' STORED AS TEXTFILE LOCATION
    '/user/hadoop/data/logging/page_views';
    OK
    Time taken: 0.063 seconds

    Suhail



    --
    Yours,
    Zheng
  • Suhail Doshi at Mar 22, 2009 at 11:10 pm
    Ah, didn't think to do that, thanks.
    On Sun, Mar 22, 2009 at 4:02 PM, Zheng Shao wrote:

    HI Suhail,

    Please use `timestamp` as field name instead. Use backquota to escape the
    field name when needed.


    Zheng

    On Sun, Mar 22, 2009 at 3:47 PM, Suhail Doshi wrote:

    I am not sure if this is a bug or just undocumented as a reserved keyword
    (or I missed it) but in case people don't know, apparently you cannot call a
    field "timestamp":

    hive> CREATE EXTERNAL TABLE page_views(project_code STRING, page STRING,
    referrer STRING, ip INT, timestamp INT) ROW FORMAT DELIMITED FIELDS
    TERMINATED BY '\001' LINES TERMINATED BY '\012' STORED AS TEXTFILE LOCATION
    '/user/hadoop/data/logging/page_views';
    FAILED: Parse Error: line 2:7 mismatched input 'EXTERNAL' expecting
    TEMPORARY in create function statement

    Time taken: 0.131 seconds
    hive> CREATE EXTERNAL TABLE page_views(project_code STRING, page STRING,
    referrer STRING, ip INT, created INT) ROW FORMAT DELIMITED FIELDS TERMINATED
    BY '\001' LINES TERMINATED BY '\012' STORED AS TEXTFILE LOCATION
    '/user/hadoop/data/logging/page_views';
    OK
    Time taken: 0.063 seconds

    Suhail



    --
    Yours,
    Zheng


    --
    http://mixpanel.com
    Blog: http://blog.mixpanel.com

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categorieshive, hadoop
postedMar 22, '09 at 10:47p
activeMar 22, '09 at 11:10p
posts3
users2
websitehive.apache.org

2 users in discussion

Suhail Doshi: 2 posts Zheng Shao: 1 post

People

Translate

site design / logo © 2021 Grokbase