Grokbase Groups Hive dev October 2014
FAQ
Hari Sekhon created HIVE-8538:
---------------------------------

              Summary: Fully qualified table error when adding partition
                  Key: HIVE-8538
                  URL: https://issues.apache.org/jira/browse/HIVE-8538
              Project: Hive
           Issue Type: Improvement
     Affects Versions: 0.13.0
          Environment: HDP 2.1
             Reporter: Hari Sekhon
             Priority: Minor


When adding a partition using a fully qualified table name I get the following error, works fine if I use database and then re-issue the query with a non-qualified table name. Other queries such as select do work with fully qualified table names so should make this allow qualified table names for convenience and consistency.

{code}
hive> alter table myDB.myTable add partition (log_date='xxxx-xx-xx');
MismatchedTokenException(27!=96)
         at org.antlr.runtime.BaseRecognizer.recoverFromMismatchedToken(BaseRecognizer.java:617)
         at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115)
         at org.apache.hadoop.hive.ql.parse.HiveParser.alterStatementSuffixExchangePartition(HiveParser.java:13264)
         at org.apache.hadoop.hive.ql.parse.HiveParser.alterTableStatementSuffix(HiveParser.java:6851)
         at org.apache.hadoop.hive.ql.parse.HiveParser.alterStatement(HiveParser.java:6552)
         at org.apache.hadoop.hive.ql.parse.HiveParser.ddlStatement(HiveParser.java:2189)
         at org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1398)
         at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1036)
         at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:199)
         at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
         at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:409)
         at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:323)
         at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:980)
         at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1045)
         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:916)
         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:906)
         at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:268)
         at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:220)
         at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:423)
         at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:793)
         at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:686)
         at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:606)
         at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
FAILED: ParseException line 1:32 mismatched input 'add' expecting KW_EXCHANGE near 'myTable' in alter exchange partition
hive> use myDB;
OK
Time taken: 0.009 seconds
hive> alter table myTable add partition (log_date='xxxx-xx-xx');
OK
Time taken: 0.157 seconds
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Search Discussions

  • Hari Sekhon (JIRA) at Oct 21, 2014 at 11:05 am
    [ https://issues.apache.org/jira/browse/HIVE-8538?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Hari Sekhon updated HIVE-8538:
    ------------------------------
         Description:
    When adding a partition using a fully qualified table name I get the following error, works fine if I use database and then re-issue the query with a non-qualified table name. Other queries such as select do work with fully qualified table names so should make this allow qualified table names for convenience and consistency.

    {code}
    hive> alter table myDB.myTable add partition (log_date='xxxx-xx-xx');
    MismatchedTokenException(27!=96)
             at org.antlr.runtime.BaseRecognizer.recoverFromMismatchedToken(BaseRecognizer.java:617)
             at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115)
             at org.apache.hadoop.hive.ql.parse.HiveParser.alterStatementSuffixExchangePartition(HiveParser.java:13264)
             at org.apache.hadoop.hive.ql.parse.HiveParser.alterTableStatementSuffix(HiveParser.java:6851)
             at org.apache.hadoop.hive.ql.parse.HiveParser.alterStatement(HiveParser.java:6552)
             at org.apache.hadoop.hive.ql.parse.HiveParser.ddlStatement(HiveParser.java:2189)
             at org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1398)
             at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1036)
             at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:199)
             at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
             at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:409)
             at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:323)
             at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:980)
             at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1045)
             at org.apache.hadoop.hive.ql.Driver.run(Driver.java:916)
             at org.apache.hadoop.hive.ql.Driver.run(Driver.java:906)
             at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:268)
             at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:220)
             at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:423)
             at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:793)
             at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:686)
             at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
             at java.lang.reflect.Method.invoke(Method.java:606)
             at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
    FAILED: ParseException line 1:32 mismatched input 'add' expecting KW_EXCHANGE near 'myTable' in alter exchange partition
    hive> use myDB;
    OK
    Time taken: 0.009 seconds
    hive> alter table myTable add partition (log_date='xxxx-xx-xx');
    OK
    Time taken: 0.157 seconds
    {code}

    Thanks

    Hari Sekhon
    http://www.linkedin.com/in/harisekhon

       was:
    When adding a partition using a fully qualified table name I get the following error, works fine if I use database and then re-issue the query with a non-qualified table name. Other queries such as select do work with fully qualified table names so should make this allow qualified table names for convenience and consistency.

    {code}
    hive> alter table myDB.myTable add partition (log_date='xxxx-xx-xx');
    MismatchedTokenException(27!=96)
             at org.antlr.runtime.BaseRecognizer.recoverFromMismatchedToken(BaseRecognizer.java:617)
             at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115)
             at org.apache.hadoop.hive.ql.parse.HiveParser.alterStatementSuffixExchangePartition(HiveParser.java:13264)
             at org.apache.hadoop.hive.ql.parse.HiveParser.alterTableStatementSuffix(HiveParser.java:6851)
             at org.apache.hadoop.hive.ql.parse.HiveParser.alterStatement(HiveParser.java:6552)
             at org.apache.hadoop.hive.ql.parse.HiveParser.ddlStatement(HiveParser.java:2189)
             at org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1398)
             at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1036)
             at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:199)
             at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
             at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:409)
             at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:323)
             at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:980)
             at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1045)
             at org.apache.hadoop.hive.ql.Driver.run(Driver.java:916)
             at org.apache.hadoop.hive.ql.Driver.run(Driver.java:906)
             at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:268)
             at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:220)
             at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:423)
             at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:793)
             at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:686)
             at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
             at java.lang.reflect.Method.invoke(Method.java:606)
             at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
    FAILED: ParseException line 1:32 mismatched input 'add' expecting KW_EXCHANGE near 'myTable' in alter exchange partition
    hive> use myDB;
    OK
    Time taken: 0.009 seconds
    hive> alter table myTable add partition (log_date='xxxx-xx-xx');
    OK
    Time taken: 0.157 seconds
    {code}

    Fully qualified table error when adding partition
    -------------------------------------------------

    Key: HIVE-8538
    URL: https://issues.apache.org/jira/browse/HIVE-8538
    Project: Hive
    Issue Type: Improvement
    Affects Versions: 0.13.0
    Environment: HDP 2.1
    Reporter: Hari Sekhon
    Priority: Minor

    When adding a partition using a fully qualified table name I get the following error, works fine if I use database and then re-issue the query with a non-qualified table name. Other queries such as select do work with fully qualified table names so should make this allow qualified table names for convenience and consistency.
    {code}
    hive> alter table myDB.myTable add partition (log_date='xxxx-xx-xx');
    MismatchedTokenException(27!=96)
    at org.antlr.runtime.BaseRecognizer.recoverFromMismatchedToken(BaseRecognizer.java:617)
    at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115)
    at org.apache.hadoop.hive.ql.parse.HiveParser.alterStatementSuffixExchangePartition(HiveParser.java:13264)
    at org.apache.hadoop.hive.ql.parse.HiveParser.alterTableStatementSuffix(HiveParser.java:6851)
    at org.apache.hadoop.hive.ql.parse.HiveParser.alterStatement(HiveParser.java:6552)
    at org.apache.hadoop.hive.ql.parse.HiveParser.ddlStatement(HiveParser.java:2189)
    at org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1398)
    at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1036)
    at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:199)
    at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
    at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:409)
    at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:323)
    at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:980)
    at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1045)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:916)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:906)
    at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:268)
    at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:220)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:423)
    at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:793)
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:686)
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
    FAILED: ParseException line 1:32 mismatched input 'add' expecting KW_EXCHANGE near 'myTable' in alter exchange partition
    hive> use myDB;
    OK
    Time taken: 0.009 seconds
    hive> alter table myTable add partition (log_date='xxxx-xx-xx');
    OK
    Time taken: 0.157 seconds
    {code}
    Thanks
    Hari Sekhon
    http://www.linkedin.com/in/harisekhon


    --
    This message was sent by Atlassian JIRA
    (v6.3.4#6332)

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categorieshive, hadoop
postedOct 21, '14 at 9:58a
activeOct 21, '14 at 11:05a
posts2
users1
websitehive.apache.org

1 user in discussion

Hari Sekhon (JIRA): 2 posts

People

Translate

site design / logo © 2022 Grokbase