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

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

Log workAgile BoardRank to TopRank to BottomBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.0.0-alpha-1
    • None
    • 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
          Ádám Szita
        2. HIVE-22099.8.patch
          39 kB
          Ádám Szita
        3. HIVE-22099.7.patch
          39 kB
          Ádám Szita
        4. HIVE-22099.6.patch
          39 kB
          Ádám Szita
        5. HIVE-22099.5.patch
          39 kB
          Ádám Szita
        6. HIVE-22099.4.patch
          39 kB
          Ádám Szita
        7. HIVE-22099.3.patch
          45 kB
          Ádám Szita
        8. HIVE-22099.2.patch
          24 kB
          Ádám Szita
        9. HIVE-22099.1.patch
          22 kB
          Ádám Szita
        10. HIVE-22099.0.patch
          5 kB
          Ádám Szita

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            szita Ádám Szita Assign to me
            szita Ádám Szita
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment