Skip to content

[TimeSeries] split handle non-successive chunks inconsistently #3941

Description

@samirromdhani

Describe the current behavior

split() works for some chunk size but fails for others when chunks are not successive.

Example

chunk1: offset = 0, values = [1, 2, 3]
chunk2: offset = 6, values = [7, 8]
# timeSeries
timeSeries (chunk1, chunk2): [1d, 2d, 3d, NaN, NaN, NaN, 7d, 8d]
  • split(2) works and returns non successive chunks:
offset = 0, values = [1, 2]
offset = 2, values = [3]
offset = 6, values = [7, 8]

These chunks are not successive: after offset 2 with size 1, the next expected offset should be 3, not 6.

  • split(3) works also.

  • but split(4) fails with:

java.lang.IllegalArgumentException: Chunks are not successive. First offset is 0 and first size is 3; second offset should be 3but is 6

Describe the expected behavior

The behavior should be consistent.

Either:

  • non successive chunks are supported, and split() should work for all valid split sizes, or
  • non successive chunks are not supported, and split() should fail consistently.

Describe the steps

  1. Create a time series with two non successive chunks:
    Example
DoubleDataChunk chunk1 = new UncompressedDoubleDataChunk(0, new double[]{1d, 2d, 3d});
DoubleDataChunk chunk2 = new UncompressedDoubleDataChunk(6, new double[]{7d, 8d});
StoredDoubleTimeSeries timeSeries = new StoredDoubleTimeSeries(metadata, chunk1, chunk2);
  1. Call split(2)
    this works
  2. Call split(3)
    this works also
  3. Call split(4)
    this fails

Environment

Version: 7.2.1

Relevant Log Output

No response

Extra Information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions