Uploaded image for project: 'Apache AsterixDB'
  1. Apache AsterixDB
  2. ASTERIXDB-1635

Overlap-bins does not start at the correct bin for dates

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Using the example on the documentation, I changed the date overlap-bins to use 10 years. The change now produces the wrong result. The result starts from 1970 instead of the correct year.

      The issue is because the days are not converted to ms when picking the starting bin.

      Sample query:

      let $itv1 := interval(time("17:23:37"), time("18:30:21"))
      let $itv2 := interval(date("1984-03-17"), date("2013-08-22"))
      let $itv3 := interval(datetime("1800-01-01T23:59:48.938"), datetime("2015-07-26T13:28:30.218"))
      return { "timebins": overlap-bins($itv1, time("00:00:00"), day-time-duration("PT30M")),
        "datebins": overlap-bins($itv2, date("1990-01-01"), year-month-duration("P10Y")),
        "datetimebins": overlap-bins($itv3, datetime("1900-01-01T00:00:00.000"), year-month-duration("P100Y")) }
      

        Attachments

          Activity

            People

            • Assignee:
              prestonc Preston Carman
              Reporter:
              prestonc Preston Carman
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: