Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dbsp: Fix hidden dependency on vec-based batches in input_upsert.
The vec-based batches set keys, values, and weights to their default values when their builders accept tuples via `Builder::push` or `Builder::push_vals`, which take mutable references. The code for `input_upsert` accumulates updates to keys in a `key_updates` vector, and then adds them to a builder via `extend`, which internally uses `Builder::push` and thus clears all the updates that were added to have weight 0. Before this commit, that code didn't later clear the `key_updates` vector, which meant that anything added later was appended to a bunch of zeroed tuples. This was benign because, the next time `key_updates` was used, it was first consolidated, which meant that all the zero-weight tuples were dropped. This failed with the file-based batches, which don't have any special optimizations for mutable references and thus don't zero anything, which meant that nothing in `key_updates` ever got cleared. This commit fixes the problem by properly clearing `key_updates` to empty after using it. Signed-off-by: Ben Pfaff <blp@feldera.com>
- Loading branch information