| 991 | namespace { |
| 992 | |
| 993 | Result<std::shared_ptr<Schema>> ExtractSchemaToBind(const acero::Declaration& declr) { |
| 994 | std::shared_ptr<Schema> bind_schema; |
| 995 | if (declr.factory_name == "scan") { |
| 996 | const auto& opts = checked_cast<const dataset::ScanNodeOptions&>(*(declr.options)); |
| 997 | bind_schema = opts.dataset->schema(); |
| 998 | } else if (declr.factory_name == "filter") { |
| 999 | auto input_declr = std::get<acero::Declaration>(declr.inputs[0]); |
| 1000 | ARROW_ASSIGN_OR_RAISE(bind_schema, ExtractSchemaToBind(input_declr)); |
| 1001 | } else if (declr.factory_name == "named_table") { |
| 1002 | const auto& opts = checked_cast<const acero::NamedTableNodeOptions&>(*declr.options); |
| 1003 | bind_schema = opts.schema; |
| 1004 | } else if (declr.factory_name == "sink") { |
| 1005 | // Note that the sink has no output_schema |
| 1006 | return bind_schema; |
| 1007 | } else { |
| 1008 | return Status::Invalid("Schema extraction failed, unsupported factory ", |
| 1009 | declr.factory_name); |
| 1010 | } |
| 1011 | return bind_schema; |
| 1012 | } |
| 1013 | |
| 1014 | Result<std::unique_ptr<substrait::ReadRel>> NamedTableRelationConverter( |
| 1015 | const std::shared_ptr<Schema>& schema, const acero::Declaration& declaration, |
nothing calls this directly
no test coverage detected