You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/06/19 07:25:00 UTC

[jira] [Work logged] (HIVE-25268) date_format udf doesn't work for dates prior to 1900 if the timezone is different from UTC

     [ https://issues.apache.org/jira/browse/HIVE-25268?focusedWorklogId=612272&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-612272 ]

ASF GitHub Bot logged work on HIVE-25268:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 19/Jun/21 07:24
            Start Date: 19/Jun/21 07:24
    Worklog Time Spent: 10m 
      Work Description: guptanikhil007 opened a new pull request #2409:
URL: https://github.com/apache/hive/pull/2409


   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://cwiki.apache.org/confluence/display/Hive/HowToContribute
     2. Ensure that you have created an issue on the Hive project JIRA: https://issues.apache.org/jira/projects/HIVE/summary
     3. Ensure you have added or run the appropriate tests for your PR: 
     4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]HIVE-XXXXX:  Your PR title ...'.
     5. Be sure to keep the PR description updated to reflect all changes.
     6. Please write your PR title to summarize what this PR proposes.
     7. If possible, provide a concise example to reproduce the issue for a faster review.
   
   -->
   
   ### What changes were proposed in this pull request?
   Use new java time APIs to get the result instead of older APIs to restore functionality
   
   
   ### Why are the changes needed?
   date_format UDF gives 
   1. incorrect time values for dates prior to 1901-01-01 00:00:00 if the timezone is not UTC
   2. incorrect date and time values for dates prior to October 15, 1582 (Default Gregorian Calendar change)
   These changes fix both of the above issues
   
   
   ### Does this PR introduce _any_ user-facing change?
   The functionality is restored for the date_format UDF
   
   
   ### How was this patch tested?
   1. Unit tests
   2. Local tests with MiniHS2 functionality
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 612272)
    Remaining Estimate: 0h
            Time Spent: 10m

> date_format udf doesn't work for dates prior to 1900 if the timezone is different from UTC
> ------------------------------------------------------------------------------------------
>
>                 Key: HIVE-25268
>                 URL: https://issues.apache.org/jira/browse/HIVE-25268
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 3.1.0, 3.1.1, 3.1.2, 4.0.0
>            Reporter: Nikhil Gupta
>            Priority: Major
>             Fix For: 4.0.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> *HDI 3.6 (Hive 1.2.1)*:
> {code:java}
>  select date_format('1400-01-14 01:00:00', 'yyyy-MM-dd HH:mm:ss Z');
>  ----------------------------+
>  | _c0 |
>  ----------------------------+
>  | 1400-01-14 01:00:00 +0700 |
>  ----------------------------+
> {code}
> *HDI 4.0(Hive 3.1, Hive 4.0):*
> {code:java}
> select date_format('1400-01-14 01:00:00', 'yyyy-MM-dd HH:mm:ss Z');
> +----------------------------+
> | _c0 |
> +----------------------------+
> | 1400-01-06 01:17:56 +0700 |
> +----------------------------+{code}
> VM timezone is set to 'Asia/Bangkok'



--
This message was sent by Atlassian Jira
(v8.3.4#803005)