Verifies the filters produced by all instances on the same backend are the same.
| 361 | |
| 362 | // Verifies the filters produced by all instances on the same backend are the same. |
| 363 | bool VerifyFiltersProduced(const vector<TPlanFragmentInstanceCtx>& instance_ctxs) { |
| 364 | int fragment_idx = -1; |
| 365 | std::unordered_set<int> first_set; |
| 366 | for (const TPlanFragmentInstanceCtx& instance_ctx : instance_ctxs) { |
| 367 | bool first_instance_of_fragment = |
| 368 | fragment_idx == -1 || fragment_idx != instance_ctx.fragment_idx; |
| 369 | if (first_instance_of_fragment) { |
| 370 | fragment_idx = instance_ctx.fragment_idx; |
| 371 | first_set.clear(); |
| 372 | for (auto f : instance_ctx.filters_produced) first_set.insert(f.filter_id); |
| 373 | } |
| 374 | if (first_set.size() != instance_ctx.filters_produced.size()) return false; |
| 375 | for (auto f : instance_ctx.filters_produced) { |
| 376 | if (first_set.find(f.filter_id) == first_set.end()) return false; |
| 377 | } |
| 378 | } |
| 379 | return true; |
| 380 | } |
| 381 | |
| 382 | Status QueryState::InitFilterBank() { |
| 383 | const NetworkAddressPB& this_krpc_address = ExecEnv::GetInstance()->krpc_address(); |