| 135 | |
| 136 | template <typename RelMessage> |
| 137 | Result<DeclarationInfo> ProcessEmit(const RelMessage& rel, |
| 138 | const DeclarationInfo& no_emit_declr, |
| 139 | const std::shared_ptr<Schema>& schema) { |
| 140 | if (rel.has_common()) { |
| 141 | switch (rel.common().emit_kind_case()) { |
| 142 | case substrait::RelCommon::EmitKindCase::kDirect: |
| 143 | return no_emit_declr; |
| 144 | case substrait::RelCommon::EmitKindCase::kEmit: { |
| 145 | ARROW_ASSIGN_OR_RAISE(auto emit_info, GetEmitInfo(rel, schema)); |
| 146 | return DeclarationInfo{ |
| 147 | acero::Declaration::Sequence({no_emit_declr.declaration, |
| 148 | {"project", acero::ProjectNodeOptions{std::move( |
| 149 | emit_info.expressions)}}}), |
| 150 | std::move(emit_info.schema)}; |
| 151 | } |
| 152 | default: |
| 153 | return Status::Invalid("Invalid emit case"); |
| 154 | } |
| 155 | } else { |
| 156 | return no_emit_declr; |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | /// In the specialization, a single ProjectNode is being used to |
| 161 | /// get the Acero relation with or without emit. |
no test coverage detected