Skip to content

Potentially Wrong Expected Output for ExpandPerHour #68

@cmoesel

Description

@cmoesel

The test CqlIntervalOperatorsTest.Expand.ExpandPerHour specifies the following CQL:

expand { Interval[@T10:00, @T12:30] } per hour

and expected result { Interval[@T10:00, @T11:00), Interval[@T11:00, @T12:00) }.

The CQL specification, however, says:

If the interval boundaries are more precise than the per quantity, the more precise values will be truncated to the precision specified by the per quantity. In these cases, the resulting list of intervals may be more broad than the input range due to this truncation.

It then uses the same exact CQL from the test case above as an example and indicates that the correct answer should be { Interval[@T10, @T10], Interval[@T11, @T11], Interval[@T12, @T12] }.

To be honest, however, I'm not sure if the example is correct since it truncated the inputs by removing minutes precision rather than setting minutes to 0. The spec does not indicate how dates should be truncated (except by example here) -- but it's notable that Interval[@T10, @T10] does not really represent the whole 10 o'clock hour since @T10 is typically interpreted as some time during the 10 o'clock hour.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions