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

unix_timestamp returns NULL for incomplete date

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.1.0
    • None
    • Clients, UDF

    Description

      select from_unixtime(unix_timestamp('202202', 'yyyyMM'), 'yyyyMMdd');

      returns 20220201 in HDI3.6(Hive1.2.1)

      returns NULL in HDI4.0(Hive3.1.0)

       

      Turns out Hive 1.2.1 has default value for year(1970), month(01), day(01).

      And Hive 3.1.0 doesn't.

       

      So in Hive 3.1.0 we have to parse a date with all 3 parts(y/m/d), otherwise it'll fail.

      Attachments

        Activity

          People

            rishikesh.mohanty Rishikesh Mohanty
            roxxette roxxette
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: