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

Function garrow_function_execute

c_glib/arrow-glib/compute.cpp:837–872  ·  view source on GitHub ↗

* garrow_function_execute: * @function: A #GArrowFunction. * @args: (element-type GArrowDatum): A list of #GArrowDatum. * @options: (nullable): Options for the execution as an object that * implements #GArrowFunctionOptions. * @context: (nullable): A #GArrowExecuteContext for the execution. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (nullable) (transfer f

Source from the content-addressed store, hash-verified

835 * Since: 1.0.0
836 */
837GArrowDatum *
838garrow_function_execute(GArrowFunction *function,
839 GList *args,
840 GArrowFunctionOptions *options,
841 GArrowExecuteContext *context,
842 GError **error)
843{
844 auto arrow_function = garrow_function_get_raw(function);
845 std::vector<arrow::Datum> arrow_args;
846 for (GList *node = args; node; node = node->next) {
847 GArrowDatum *datum = GARROW_DATUM(node->data);
848 arrow_args.push_back(garrow_datum_get_raw(datum));
849 }
850 const arrow::compute::FunctionOptions *arrow_options;
851 if (options) {
852 arrow_options = garrow_function_options_get_raw(options);
853 } else {
854 arrow_options = arrow_function->default_options();
855 }
856 arrow::Result<arrow::Datum> arrow_result_result;
857 if (context) {
858 auto arrow_context = garrow_execute_context_get_raw(context);
859 arrow_result_result =
860 arrow_function->Execute(arrow_args, arrow_options, arrow_context);
861 } else {
862 arrow::compute::ExecContext arrow_context;
863 arrow_result_result =
864 arrow_function->Execute(arrow_args, arrow_options, &arrow_context);
865 }
866 if (garrow::check(error, arrow_result_result, "[function][execute]")) {
867 auto arrow_result = *arrow_result_result;
868 return garrow_datum_new_raw(&arrow_result);
869 } else {
870 return NULL;
871 }
872}
873
874/**
875 * garrow_function_get_name:

Callers

nothing calls this directly

Calls 7

garrow_function_get_rawFunction · 0.85
garrow_datum_new_rawFunction · 0.85
push_backMethod · 0.80
checkFunction · 0.70
ExecuteMethod · 0.45

Tested by

no test coverage detected