asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <>
Subject [jira] [Commented] (ASTERIXDB-1635) Overlap-bins does not start at the correct bin for dates
Date Fri, 09 Sep 2016 16:42:20 GMT


ASF subversion and git services commented on ASTERIXDB-1635:

Commit 2a73f411264b282aefed51fa35322187f892d707 in asterixdb's branch refs/heads/master from
[;h=2a73f41 ]

ASTERIXDB-1635 Fix for overlap-bins start for dates.

The fix involves two code changes and several sonar fixes.
The code changes are the following:
 - DurationArithmeticOperations line 75:
    When the month was zero, an index out of bound error occured in line 88 or 92.
    The month value should be between 1 and 12.
 - OverlapBinsDescriptor line 170:
    The Gregorian Calendar is expecting a value in ms. When a date value comes in,
    AsterixDB represents the value as the number of days from epoc. So the year
    for a date basically allways translated to 1970. In lines 121, a condition
    was added to check if the interval was a date, if so, convert the date to

Change-Id: I24122a84ef9edda4b05260af881c430177f1dc86
Tested-by: Jenkins <>
Integration-Tests: Jenkins <>
Reviewed-by: Steven Jacobs <>

> Overlap-bins does not start at the correct bin for dates
> --------------------------------------------------------
>                 Key: ASTERIXDB-1635
>                 URL:
>             Project: Apache AsterixDB
>          Issue Type: Bug
>            Reporter: Preston Carman
>            Assignee: Preston Carman
>            Priority: Minor
> 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
> The issue is because the days are not converted to ms when picking the starting bin.
> Sample query:
> {noformat}
> 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"))
> {noformat}

This message was sent by Atlassian JIRA

View raw message