Preston Carman created ASTERIXDB-1635:
-----------------------------------------

             Summary: Overlap-bins does not start at the correct bin for dates
                 Key: ASTERIXDB-1635
                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-1635
             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 year. 

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
(v6.3.4#6332)

Reply via email to