MCPcopy Create free account
hub / github.com/apache/arrow / ProcessEmit

Function ProcessEmit

cpp/src/arrow/engine/substrait/relation_internal.cc:137–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135
136template <typename RelMessage>
137Result<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.

Callers 1

FromProtoFunction · 0.85

Calls 2

ProcessEmitProjectFunction · 0.85
InvalidFunction · 0.50

Tested by

no test coverage detected