microsoft / Trill

Trill is a single-node query processor for temporal or streaming data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stitch doesn't seem to work for Partitioned streams

nsulikowski opened this issue · comments

        [Fact]
        public void PartitionedStreamEvent_EndStart_Stitching_Test()
        {
            PartitionedStreamEvent<string, IONRecord> last;
            var input = new List<PartitionedStreamEvent<string, IONRecord>>
            {
                (last = PartitionedStreamEvent.CreateStart(key: "c1", startTime: 1, payload: new IONRecord { Id = "c1", Data = "shortdes1" })),
                PartitionedStreamEvent.CreateEnd(key: "c1", endTime: 7, originalStartTime: last.StartTime, payload: last.Payload),

                (last = PartitionedStreamEvent.CreateStart(key: "c1", startTime: 7, payload: new IONRecord { Id = "c1", Data = "shortdes1" }))
            }.ToObservable().ToStreamable();

            UnitTests_Funcs.RunAndAssert(new[]
            {
                " #                                         01234567 ",
                " 1 (c1)[Start: 1, {Id:c1, Data:shortdes1}]  [       ",
                " 2 (c1)[End: 7,1, {Id:c1, Data:shortdes1}]  ------) ",
                " 3 (c1)[Start: 7, {Id:c1, Data:shortdes1}]        [ ",
                " 4 [LowWatermark: +inf]                             ",
            }, input, onlyData: false);

            var output = input.Stitch();
            UnitTests_Funcs.RunAndAssert(new[]
            {
                " #                                         01234567 ",
                " 1 (c1)[Start: 1, {Id:c1, Data:shortdes1}]  [       ",
                " 2 (c1)[End: 7,1, {Id:c1, Data:shortdes1}]  ------) ",
                " 3 (c1)[Start: 7, {Id:c1, Data:shortdes1}]        [ ",
                " 4 [LowWatermark: +inf]                             ",
            }, output, onlyData: false);
        }

Fixed with #81