[ 
https://issues.apache.org/jira/browse/HIVE-9430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14301391#comment-14301391
 ] 

Sergio Peña commented on HIVE-9430:
-----------------------------------

hi [~szehon]

This patch only handles the NPE. 
However, a better message is thrown later in the code when a null value is 
detected. This is already implemented and works well.

> NullPointerException on ALTER TABLE ADD PARTITION if no value given
> -------------------------------------------------------------------
>
>                 Key: HIVE-9430
>                 URL: https://issues.apache.org/jira/browse/HIVE-9430
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Processor
>    Affects Versions: 0.13.0
>            Reporter: Danny Lade
>            Assignee: Sergio Peña
>         Attachments: HIVE-9430.1.patch
>
>
> ALTER TABLE xxx ADD PARTITION (yyy) results in NullPointerException:
> {code:java}
> 2015-01-21 10:31:12,636 ERROR [main]: ql.Driver 
> (SessionState.java:printError(545)) - FAILED: NullPointerException null
> java.lang.NullPointerException
>         at 
> org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer.validatePartitionValues(DDLSemanticAnalyzer.java:2999)
>         at 
> org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer.analyzeAlterTableAddParts(DDLSemanticAnalyzer.java:2680)
>         at 
> org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer.analyzeInternal(DDLSemanticAnalyzer.java:393)
>         at 
> org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:327)
>         at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:422)
>         at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:322)
>         at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:975)
>         at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1040)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:911)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:901)
>         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:792)
>         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)
> {code}
> Therefore there is currently no way to add a partition to an already existing 
> table.:
> {code:SQL}
> alter table XXX add partition (YYY = 'VALUE');
> FAILED: SemanticException table is not partitioned but partition spec exists: 
> {YYY=VALUE}
> {code}



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

Reply via email to