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

Several date related UDFs can't handle Julian dates properly since HIVE-20007

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0.0
    • Component/s: None
    • Labels:
      None

      Description

      Currently dates that belong to Julian calendar (before Oct 15, 1582) are handled improperly by date/timestamp UDFs.

      E.g. DateFormat UDF:

      Although the dates are in Julian calendar, the formatter insists to print these according to Gregorian calendar causing multiple days of difference in some cases:

       

      beeline> select date_format('1001-01-05','dd---MM--yyyy');
      +----------------+
      | _c0 |
      +----------------+
      | 30---12--1000 |
      +----------------+

       I've observed similar problems in the following UDFs:

      • add_months
      • date_format
      • day
      • month
      • months_between
      • weekofyear
      • year

       

        Attachments

        1. HIVE-22099.9.patch
          39 kB
          Adam Szita
        2. HIVE-22099.8.patch
          39 kB
          Adam Szita
        3. HIVE-22099.7.patch
          39 kB
          Adam Szita
        4. HIVE-22099.6.patch
          39 kB
          Adam Szita
        5. HIVE-22099.5.patch
          39 kB
          Adam Szita
        6. HIVE-22099.4.patch
          39 kB
          Adam Szita
        7. HIVE-22099.3.patch
          45 kB
          Adam Szita
        8. HIVE-22099.2.patch
          24 kB
          Adam Szita
        9. HIVE-22099.1.patch
          22 kB
          Adam Szita
        10. HIVE-22099.0.patch
          5 kB
          Adam Szita

          Activity

            People

            • Assignee:
              szita Adam Szita
              Reporter:
              szita Adam Szita
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: