You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Slim Bouguerra (Jira)" <ji...@apache.org> on 2019/11/09 00:18:00 UTC

[jira] [Updated] (HIVE-22476) Hive datediff function provided inconsistent results when hive.fetch.task.conversion is set to none

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

Slim Bouguerra updated HIVE-22476:
----------------------------------
    Status: Patch Available  (was: Open)

> Hive datediff function provided inconsistent results when hive.fetch.task.conversion is set to none
> ---------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-22476
>                 URL: https://issues.apache.org/jira/browse/HIVE-22476
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Slim Bouguerra
>            Assignee: Slim Bouguerra
>            Priority: Major
>
> The actual issue stems to the different date parser used by various part of the engine.
> Fetch task uses udfdatediff via {code} org.apache.hadoop.hive.ql.udf.generic.GenericUDFToDate{code} while the vectorized llap execution uses {code}VectorUDFDateDiffScalarCol{code}.
> This fix is meant to be not very intrusive and will add more support to the GenericUDFToDate by enhancing the parser.
> For the longer term will be better to use one parser for all the operators.
> Thanks [~Rajkumar Singh] for the repro example
> {code} 
> create external table testdatediff(datetimecol string) stored as orc;
> insert into testdatediff values ('2019-09-09T10:45:49+02:00'),('2019-07-24');
> select datetimecol from testdatediff where datediff(cast(current_timestamp as string), datetimecol)<183;
> set hive.ferch.task.conversion=none;
> select datetimecol from testdatediff where datediff(cast(current_timestamp as string), datetimecol)<183;
> {code}



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