You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Stamatis Zampetakis (Jira)" <ji...@apache.org> on 2024/06/21 10:09:00 UTC

[jira] [Commented] (HIVE-28337) TestMetaStoreUtils fails for invalid timestamps

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

Stamatis Zampetakis commented on HIVE-28337:
--------------------------------------------

The description of the ticket implies that there is a bug in the testing methodology but I would argue that the bug is in the production code instead.

The test aims to ensure that the conversion from/to string does not alter the value in any way no matter the timezone. The DATE, and TIMESTAMP datatypes in standard SQL are timezone agnostic and the [same semantics are adopted in Hive|https://cwiki.apache.org/confluence/display/Hive/Different+TIMESTAMP+types]. There are still various known issues in Hive for dates/timestamps that fall into DST shift and the MetaStoreUtils API is probably affected.

 

 

> TestMetaStoreUtils fails for invalid timestamps
> -----------------------------------------------
>
>                 Key: HIVE-28337
>                 URL: https://issues.apache.org/jira/browse/HIVE-28337
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Kiran Velumuri
>            Assignee: Kiran Velumuri
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: image-2024-06-18-12-42-05-646.png, image-2024-06-18-12-42-31-472.png
>
>
> The test org.apache.hadoop.hive.metastore.utils.TestMetaStoreUtils#testTimestampToString and #testDateToString fails for invalid timestamps in the following cases:
> 1. Timestamps in time-zones which observe daylight savings during which the clock is set forward(typicallly 2:00 AM - 3:00 AM)
> Example: 2417-03-26T02:08:43 in Europe/Paris is invalid, and would get converted to 2417-03-26T03:08:43 by Timestamp.valueOf() method
> This is happening due to representing timestamp as LocalDateTime in TestMetaStoreUtils, which is independent of the time-zone of the timestamp. This LocalDateTime timestamp when combined with time-zone is leading to invalid timestamp.
>  
> 2. Timestamps with year as '0000'
> Example: 0000-01-07T22:44:36 is invalid and would get converted to 0001-01-07T22:44:36 by Timestamp.valueof() method
> Year '0000' is invalid and should not be included while generating the test cases.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)