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/08/02 12:30:00 UTC

[jira] [Work logged] (HIVE-25403) from_unixtime() does not consider leap seconds

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

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

                Author: ASF GitHub Bot
            Created on: 02/Aug/21 12:29
            Start Date: 02/Aug/21 12:29
    Worklog Time Spent: 10m 
      Work Description: sruthim-official commented on a change in pull request #2550:
URL: https://github.com/apache/hive/pull/2550#discussion_r680929457



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFromUnixTime.java
##########
@@ -60,7 +62,7 @@
 
   private transient SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

Review comment:
       Removed the variable from the code.

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFromUnixTime.java
##########
@@ -60,7 +62,7 @@
 
   private transient SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
   private transient String lastFormat = null;
-
+  private transient DateTimeFormatter FORMATTER =  DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");

Review comment:
       Done

##########
File path: ql/src/test/queries/clientpositive/udf5.q
##########
@@ -13,6 +13,8 @@ SELECT from_unixtime(unix_timestamp('2010-01-13 11:57:40', 'yyyy-MM-dd HH:mm:ss'
 
 SELECT from_unixtime(unix_timestamp('2010-01-13 11:57:40', 'yyyy-MM-dd HH:mm:ss'), 'MM/dd/yy HH:mm:ss'), from_unixtime(unix_timestamp('2010-01-13 11:57:40')) from dest1_n14;
 
+SELECT from_unixtime(unix_timestamp(cast('2010-01-13' as date)));

Review comment:
       Added tests with diff time zone.




-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

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


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

    Worklog Id:     (was: 632304)
    Time Spent: 50m  (was: 40m)

>  from_unixtime() does not consider leap seconds
> -----------------------------------------------
>
>                 Key: HIVE-25403
>                 URL: https://issues.apache.org/jira/browse/HIVE-25403
>             Project: Hive
>          Issue Type: Sub-task
>          Components: Hive
>            Reporter: Sruthi Mooriyathvariam
>            Assignee: Sruthi Mooriyathvariam
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 3.1.2
>
>         Attachments: image-2021-07-29-14-42-49-806.png
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> The Unix_timestamp() considers "leap second" while the from_unixtime is not; which results in to wrong result as below:
> !image-2021-07-29-14-42-49-806.png!



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