* garrow_execute_plan_build_node: * @plan: A #GArrowExecutePlan. * @factory_name: A factory name to build a #GArrowExecuteNode. * @inputs: (element-type GArrowExecuteNode): An inputs to execute new node. * @options: A #GArrowExecuteNodeOptions for new node. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (transfer full): A newly built and added #GArrowExecuteNode
| 2264 | * Since: 6.0.0 |
| 2265 | */ |
| 2266 | GArrowExecuteNode * |
| 2267 | garrow_execute_plan_build_node(GArrowExecutePlan *plan, |
| 2268 | const gchar *factory_name, |
| 2269 | GList *inputs, |
| 2270 | GArrowExecuteNodeOptions *options, |
| 2271 | GError **error) |
| 2272 | { |
| 2273 | auto arrow_plan = garrow_execute_plan_get_raw(plan); |
| 2274 | std::vector<arrow::acero::ExecNode *> arrow_inputs; |
| 2275 | for (auto node = inputs; node; node = node->next) { |
| 2276 | auto arrow_node = garrow_execute_node_get_raw(GARROW_EXECUTE_NODE(node->data)); |
| 2277 | arrow_inputs.push_back(arrow_node); |
| 2278 | } |
| 2279 | auto arrow_options = garrow_execute_node_options_get_raw(options); |
| 2280 | auto arrow_node_result = arrow::acero::MakeExecNode(factory_name, |
| 2281 | arrow_plan.get(), |
| 2282 | arrow_inputs, |
| 2283 | *arrow_options); |
| 2284 | if (garrow::check(error, arrow_node_result, "[execute-plan][build-node]")) { |
| 2285 | auto arrow_node = *arrow_node_result; |
| 2286 | arrow_node->SetLabel(factory_name); |
| 2287 | auto node = garrow_execute_node_new_raw(arrow_node, options); |
| 2288 | g_object_ref(node); |
| 2289 | auto priv = GARROW_EXECUTE_PLAN_GET_PRIVATE(plan); |
| 2290 | priv->nodes = g_list_prepend(priv->nodes, node); |
| 2291 | return node; |
| 2292 | } else { |
| 2293 | return NULL; |
| 2294 | } |
| 2295 | } |
| 2296 | |
| 2297 | /** |
| 2298 | * garrow_execute_plan_build_source_node: |
no test coverage detected