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

Enforce timestamp range

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.1.0
    • None
    • Hive

    Description

      Our Wiki specifies a range for DATE, but not for TIMESTAMP (well, there's a specified format (yyyy) but no explicitly specified range). [1]

      TIMESTAMP used to have inner representation of java.sql.Timestamp which couldn't handle timestamps outside of the range of years 0000-9999. (0000 converted to 0001)
      Since the inner representation was changed to LocalDateTime (HIVE-20007), negative timestamps overflow because of a formatting error.
      I propose simply disabling negative timestamps, and timestamps beyond year 9999. No data is much better than bad data.

      See [2] for more details.

      [1] https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types#LanguageManualTypes-TimestampstimestampTimestamps
      [2] https://docs.google.com/document/d/1y-GcyzzALXM2AJB3bFuyTAEq5fq6p41gu5eH1pF8I7o/edit?usp=sharing

      Attachments

        1. HIVE-21234.1.patch
          6 kB
          Karen Coppage
        2. HIVE-21234.2.patch
          6 kB
          Karen Coppage
        3. HIVE-21234.3.patch
          21 kB
          Karen Coppage
        4. HIVE-21234.4.patch
          79 kB
          Karen Coppage

        Activity

          People

            klcopp Karen Coppage
            klcopp Karen Coppage
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: