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

Function CreateScanAggSubstrait

cpp/src/arrow/engine/substrait/test_plan_builder.cc:217–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215}
216
217Result<std::shared_ptr<Buffer>> CreateScanAggSubstrait(
218 Id function_id, const std::shared_ptr<Table>& input_table,
219 const std::vector<int>& key_idxs, const std::vector<int>& arg_idxs,
220 const DataType& output_type) {
221 ExtensionSet ext_set;
222
223 ARROW_ASSIGN_OR_RAISE(std::unique_ptr<substrait::ReadRel> read,
224 CreateRead(*input_table, &ext_set));
225 ARROW_ASSIGN_OR_RAISE(
226 std::unique_ptr<substrait::AggregateRel> agg,
227 CreateAgg(function_id, key_idxs, arg_idxs, output_type, &ext_set));
228
229 auto read_rel = std::make_unique<substrait::Rel>();
230 read_rel->set_allocated_read(read.release());
231 agg->set_allocated_input(read_rel.release());
232
233 auto agg_rel = std::make_unique<substrait::Rel>();
234 agg_rel->set_allocated_aggregate(agg.release());
235
236 ARROW_ASSIGN_OR_RAISE(std::unique_ptr<substrait::Plan> plan,
237 CreatePlan(std::move(agg_rel), &ext_set));
238 return Buffer::FromString(plan->SerializeAsString());
239}
240
241} // namespace internal
242} // namespace engine

Callers 1

PlanFromAggregateCaseFunction · 0.85

Calls 6

CreateReadFunction · 0.85
CreateAggFunction · 0.85
CreatePlanFunction · 0.85
FromStringFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.70
releaseMethod · 0.45

Tested by

no test coverage detected