Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-5864

getValueAs reports the wrong number of milliseconds for WEEK and the wrong number of months for QUARTER

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • core

    Description

      The change that introduced WEEK and QUARTER processing here did not correctly implement the `evaluateIntervalLiteralAsX` functions for these two time units.

      For both of them, it used the `fillIntervalValueArray` with the week parameter being used for months and the quarter parameter being used for months with no modifications to the underlying values.

      For weeks, this results in the field being misused as the hour parameter so 2 weeks becomes 2 hours. For quarters, this results in the field being misused as months so 2 quarters becomes 2 months.

      I believe the proper way to implement these is to perform the modification so weeks gets translated to 7 days and quarters gets translated to 3 months.

      This seems to only affect the string versions such as `INTERVAL '2' WEEK`. The integer variants don't seem to use the literal pathway so they aren't affected.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jsternberg Jonathan A Sternberg
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: