hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashish Sharma (Jira)" <j...@apache.org>
Subject [jira] [Resolved] (HIVE-23752) Cast as Date for invalid date produce the valid output
Date Mon, 26 Jul 2021 05:07:00 GMT

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

Ashish Sharma resolved HIVE-23752.
----------------------------------
      Assignee: Ashish Sharma
    Resolution: Duplicate

fixed as part of https://issues.apache.org/jira/browse/HIVE-25306

> Cast as Date for invalid date produce the valid output
> ------------------------------------------------------
>
>                 Key: HIVE-23752
>                 URL: https://issues.apache.org/jira/browse/HIVE-23752
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>    Affects Versions: 4.0.0
>            Reporter: Rajkumar Singh
>            Assignee: Ashish Sharma
>            Priority: Major
>              Labels: hive
>
> Hive-3:
> {code:java}
> select cast("0000-00-00" as date) 
> 0002-11-30 
> select cast("2010-27-54" as date)
>  2012-04-23
> select cast("1992-00-74" as date) ;
> 1992-02-12
> {code}
> The reason Hive allowing is because Parser formatted is set to LENIENT https://github.com/apache/hive/blob/ae008b79b5d52ed6a38875b73025a505725828eb/common/src/java/org/apache/hadoop/hive/common/type/Date.java#L50,
this seems to be an intentional change as changing the ResolverStyle to STRICT start failing
the tests.



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

Mime
View raw message