* garrow_call_expression_new: * @function: A name of function to be called. * @arguments: (element-type GArrowExpression): Arguments of this call. * @options: (nullable): A #GArrowFunctionOptions for the called function. * * Returns: A newly created #GArrowCallExpression. * * Since: 6.0.0 */
| 344 | * Since: 6.0.0 |
| 345 | */ |
| 346 | GArrowCallExpression * |
| 347 | garrow_call_expression_new(const gchar *function, |
| 348 | GList *arguments, |
| 349 | GArrowFunctionOptions *options) |
| 350 | { |
| 351 | std::vector<arrow::compute::Expression> arrow_arguments; |
| 352 | for (GList *node = arguments; node; node = node->next) { |
| 353 | auto argument = GARROW_EXPRESSION(node->data); |
| 354 | auto arrow_argument = garrow_expression_get_raw(argument); |
| 355 | arrow_arguments.push_back(*arrow_argument); |
| 356 | } |
| 357 | std::shared_ptr<arrow::compute::FunctionOptions> arrow_options; |
| 358 | if (options) { |
| 359 | arrow_options.reset(garrow_function_options_get_raw(options)->Copy().release()); |
| 360 | } |
| 361 | auto arrow_expression = arrow::compute::call(function, arrow_arguments, arrow_options); |
| 362 | auto expression = GARROW_CALL_EXPRESSION(garrow_expression_new_raw(arrow_expression)); |
| 363 | auto priv = GARROW_CALL_EXPRESSION_GET_PRIVATE(expression); |
| 364 | priv->arguments = |
| 365 | g_list_copy_deep(arguments, reinterpret_cast<GCopyFunc>(g_object_ref), nullptr); |
| 366 | return expression; |
| 367 | } |
| 368 | |
| 369 | /** |
| 370 | * garrow_call_expression_get_arguments: |
nothing calls this directly
no test coverage detected