Skip to content

Fix Motion(Segment) with Buckets::All

At the moment if the plan tree contains a Motion(Segment) and the top of the plan should be executed on all buckets (a common case for UnionAll with GroupBy and Scan) we are in trouble. Current code would dispatch the whole copy of the virtual table to all storages that returns an incorrect result for UnionAll. Previously it was not a problem for InnerJoin or SubQuery as the storages would filter redundant tuples. But UnionAll requires a fix: we can't build a common plan to dispatch to all storages but rather build a unique plan per each storage with a corresponding data portion of the virtual table.

Edited by Denis Smirnov