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

from_unixtime returns wrong year for Dec 31 timestamps with format 'YYYY'

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.1.0
    • None
    • None
    • AWS EMR with Hive 2.1.0-amzn-0

    Description

      If you use capital Ys as a year format in from_unixtime() it returns next year for Dec 31 only. All other days work as intended.

      Here is reproduction code:

      hive> select from_unixtime(1514754599, 'YYYY-MM-dd HH-mm-ss'), from_unixtime(1514754599, 'yyyy-MM-dd HH-mm-ss');
      OK
      2018-12-31 21-09-59	2017-12-31 21-09-59
      Time taken: 0.025 seconds, Fetched: 1 row(s)
      hive>
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            nickorka Nick Orka
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: