microsoft / Trill

Trill is a single-node query processor for temporal or streaming data.
MIT License
1.25k stars 132 forks source link

Fixing DisjointUnion bug resulting in negative low watermark #124

Closed peterfreiling closed 4 years ago

peterfreiling commented 4 years ago

DisjointUnion initializes its low watermarks for left/right side of the union to long.MinValue, but when searching a batch for a low watermark, it initializes the value to -1 which signifies no low watermark present. So if the first batch it receives does not have a low watermark, and one of the sides has not yet processed a valid low watermark, it will compare the "new low watermark" of -1 to the initialized long.MinValue, and wrongfully emit a low watermark of -1. The fix is to initialize the low watermarks for each side to 0, since we should never emit a low watermark <= 0.