Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-23752

Cast as Date for invalid date produce the valid output

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 4.0.0
    • None
    • Hive

    Description

      Hive-3:

      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
      
      

      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.

      Attachments

        Issue Links

          Activity

            People

              ashish-kumar-sharma Ashish Sharma
              Rajkumar Singh Rajkumar Singh
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: