hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-17038) invalid result when CAST-ing to DATE
Date Wed, 12 Jul 2017 10:34:00 GMT

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

ASF GitHub Bot commented on HIVE-17038:
---------------------------------------

GitHub user mlorek opened a pull request:

    https://github.com/apache/hive/pull/204

    HIVE-17038 - DateParser fix

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mlorek/hive master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/hive/pull/204.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #204
    
----
commit 1e4eb6a870af2ce3ec1e5116a81e6453f9fc990d
Author: Michael Lorek <mlorek@ftservices.ie>
Date:   2017-07-12T10:30:22Z

    HIVE-17038 - DateParser fix

----


> invalid result when CAST-ing to DATE
> ------------------------------------
>
>                 Key: HIVE-17038
>                 URL: https://issues.apache.org/jira/browse/HIVE-17038
>             Project: Hive
>          Issue Type: Bug
>          Components: CLI, Hive
>    Affects Versions: 1.2.1
>            Reporter: Jim Hopper
>
> when casting incorrect date literals to DATE data type hive returns wrong values instead
of NULL.
> {code}
> SELECT CAST('2017-02-31' AS DATE);
> SELECT CAST('2017-04-31' AS DATE);
> {code}
> Some examples below where it really can produce weird results:
> {code}
> select *
>   from (
> select cast('2017-07-01' as date) as dt
> ) as t
> where t.dt = '2017-06-31';
> select *
>   from (
> select cast('2017-07-01' as date) as dt
> ) as t
> where t.dt = cast('2017-06-31' as date);
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message