| 347 | : ds_to_frag_map(std::move(ds_to_frag_map)), dataset_schema(dataset_schema) {} |
| 348 | |
| 349 | Result<compute::Expression> GetGuarantee( |
| 350 | const std::vector<FieldPath>& dataset_schema_selection) const override { |
| 351 | std::vector<compute::Expression> missing_fields; |
| 352 | for (const FieldPath& path : dataset_schema_selection) { |
| 353 | int top_level_field_idx = path[0]; |
| 354 | if (ds_to_frag_map[top_level_field_idx] < 0) { |
| 355 | missing_fields.push_back( |
| 356 | compute::is_null(compute::field_ref(top_level_field_idx))); |
| 357 | } |
| 358 | } |
| 359 | if (missing_fields.empty()) { |
| 360 | return compute::literal(true); |
| 361 | } |
| 362 | if (missing_fields.size() == 1) { |
| 363 | return missing_fields[0]; |
| 364 | } |
| 365 | return compute::and_(std::move(missing_fields)); |
| 366 | } |
| 367 | |
| 368 | Result<std::unique_ptr<FragmentSelection>> DevolveSelection( |
| 369 | const std::vector<FieldPath>& dataset_schema_selection) const override { |