[ 
https://issues.apache.org/jira/browse/HIVE-4928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Phabricator updated HIVE-4928:
------------------------------

    Attachment: HIVE-4928.D11871.1.patch

jdere requested code review of "HIVE-4928 [jira] Date literals do not work 
properly in partition spec clause".

Reviewers: JIRA

HIVE-4928 fix date literal parsing to work in partition_spec clause

The partition spec parsing doesn't do any actual real evaluation of the values 
in the partition spec, instead just taking the text value of the ASTNode 
representing the partition value. This works fine for string/numeric literals 
(expression tree below):

(TOK_PARTVAL region 99)

But not for Date literals which are of form DATE 'yyyy-mm-dd' (expression tree 
below:

(TOK_DATELITERAL '1999-12-31')

In this case the parser/analyzer uses "TOK_DATELITERAL" as the partition column 
value, when it should really get value of the child of the DATELITERAL token.

TEST PLAN
  EMPTY

REVISION DETAIL
  https://reviews.facebook.net/D11871

AFFECTED FILES
  ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g
  ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java
  ql/src/test/queries/clientpositive/partition_date2.q
  ql/src/test/results/clientpositive/partition_date2.q.out

MANAGE HERALD RULES
  https://reviews.facebook.net/herald/view/differential/

WHY DID I GET THIS EMAIL?
  https://reviews.facebook.net/herald/transcript/28221/

To: JIRA, jdere

                
> Date literals do not work properly in partition spec clause
> -----------------------------------------------------------
>
>                 Key: HIVE-4928
>                 URL: https://issues.apache.org/jira/browse/HIVE-4928
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Processor
>            Reporter: Jason Dere
>            Assignee: Jason Dere
>         Attachments: HIVE-4928.1.patch.txt, HIVE-4928.D11871.1.patch
>
>
> The partition spec parsing doesn't do any actual real evaluation of the 
> values in the partition spec, instead just taking the text value of the 
> ASTNode representing the partition value. This works fine for string/numeric 
> literals (expression tree below):
> (TOK_PARTVAL region 99)
> But not for Date literals which are of form DATE 'yyyy-mm-dd' (expression 
> tree below:
> (TOK_DATELITERAL '1999-12-31')
> In this case the parser/analyzer uses "TOK_DATELITERAL" as the partition 
> column value, when it should really get value of the child of the DATELITERAL 
> token.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to