| 979 | namespace { |
| 980 | |
| 981 | Result<std::shared_ptr<Schema>> ExtractSchemaToBind(const acero::Declaration& declr) { |
| 982 | std::shared_ptr<Schema> bind_schema; |
| 983 | if (declr.factory_name == "scan") { |
| 984 | const auto& opts = checked_cast<const dataset::ScanNodeOptions&>(*(declr.options)); |
| 985 | bind_schema = opts.dataset->schema(); |
| 986 | } else if (declr.factory_name == "filter") { |
| 987 | auto input_declr = std::get<acero::Declaration>(declr.inputs[0]); |
| 988 | ARROW_ASSIGN_OR_RAISE(bind_schema, ExtractSchemaToBind(input_declr)); |
| 989 | } else if (declr.factory_name == "named_table") { |
| 990 | const auto& opts = checked_cast<const acero::NamedTableNodeOptions&>(*declr.options); |
| 991 | bind_schema = opts.schema; |
| 992 | } else if (declr.factory_name == "sink") { |
| 993 | // Note that the sink has no output_schema |
| 994 | return bind_schema; |
| 995 | } else { |
| 996 | return Status::Invalid("Schema extraction failed, unsupported factory ", |
| 997 | declr.factory_name); |
| 998 | } |
| 999 | return bind_schema; |
| 1000 | } |
| 1001 | |
| 1002 | Result<std::unique_ptr<substrait::ReadRel>> NamedTableRelationConverter( |
| 1003 | const std::shared_ptr<Schema>& schema, const acero::Declaration& declaration, |
nothing calls this directly
no test coverage detected