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

Shengsheng Huang commented on HIVE-3148:
----------------------------------------

I dumped the AST of the ALTER command using explain, and found it already build 
the wrong node, as below.  

  (TOK_ALTERTABLE_ADDPARTS t (TOK_PARTSPEC (TOK_PARTVAL p 1)) 
(TOK_PARTITIONLOCATION '/Users/carl/1') (TOK_PARTSPEC (TOK_PARTVAL p 2)) 
(TOK_PARTITIONLOCATION '/Users/carl/1'))

In the above AST, TOK_PARTSPEC (specification of partition) and 
TOK_PARTITIONLOCATION (partition location) nodes are all siblings, which does 
not make much sense to me. So in my patch I rearranged the AST a bit by 
attaching the TOK_PARTITIONLOCATION to TOK_PARTSPEC node, as below:
 
  (TOK_ALTERTABLE_ADDPARTS t (TOK_PARTSPEC (TOK_PARTVAL p 1) 
(TOK_PARTITIONLOCATION '/Users/carl/1')) (TOK_PARTSPEC (TOK_PARTVAL p 2) 
(TOK_PARTITIONLOCATION '/Users/carl/2')))

This way locations can correctly identified and analyzed.  

                
> LOCATION clause is not honored when adding multiple partitions
> --------------------------------------------------------------
>
>                 Key: HIVE-3148
>                 URL: https://issues.apache.org/jira/browse/HIVE-3148
>             Project: Hive
>          Issue Type: Bug
>          Components: Metastore, Query Processor
>    Affects Versions: 0.4.0, 0.5.0, 0.6.0, 0.7.0, 0.8.0, 0.9.0
>            Reporter: Carl Steinbach
>         Attachments: 3148.for0.9.0.patch
>
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to