[
https://issues.apache.org/jira/browse/HIVE-28355?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated HIVE-28355:
----------------------------------
Labels: pull-request-available (was: )
> Fix intermittent failure of
> TestHplSqlViaBeeLine#testUNIX_TIMESTAMPHplSQLFunction
> ---------------------------------------------------------------------------------
>
> Key: HIVE-28355
> URL: https://issues.apache.org/jira/browse/HIVE-28355
> Project: Hive
> Issue Type: Bug
> Reporter: Kiran Velumuri
> Assignee: Kiran Velumuri
> Priority: Major
> Labels: pull-request-available
> Attachments: image-2024-06-27-12-27-47-772.png
>
>
> The test TestHplSqlViaBeeLine#testUNIX_TIMESTAMPHplSQLFunction compares
> UNIX_TIMESTAMP() with System.currentTimeMillis() using regex.
> Instead of seconds(divide by 1000), it compares in 10s of seconds(divide by
> 10000) to account for the difference of few seconds that might come up
> between the execution of the System.currentTimeMillis()/10000 and
> UNIX_TIMESTAMP().
> However, it fails in the case when System.currentTimeMillis()(in seconds)
> differs from UNIX_TIMESTAMP() in 10s digit and/or 100s digit and/or 1000s
> digit and so on
>
> Examples:
> The current comparison is highlighted in bold.
> 1. Difference in 1s digit - success
> System.currentTimeMillis() in seconds - {*}171946770{*}5
> UNIX_TIMESTAMP() - {*}171946770{*}6
>
> 2. Difference in 10s digit - fail
> System.currentTimeMillis() in seconds - {*}171946770{*}9
> UNIX_TIMESTAMP() - {*}171946771{*}0
>
> 3. Difference in 100s digit - fail
> System.currentTimeMillis() in seconds - {*}171946779{*}9
> UNIX_TIMESTAMP() - {*}171946780{*}0
>
> 4. Difference in 1000s digit - fail
> System.currentTimeMillis() in seconds - {*}171946799{*}9
> UNIX_TIMESTAMP() - {*}171946800{*}0
--
This message was sent by Atlassian Jira
(v8.20.10#820010)