Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-8538

Fully qualified table error when adding partition

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 0.13.0
    • None
    • None
    • None
    • HDP 2.1

    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.

      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
      

      Thanks

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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              harisekhon Hari Sekhon
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: