@@ -178,6 +178,8 @@ G_BEGIN_DECLS
178178 *
179179 * #GArrowSourceNodeOptions is a class to customize a source node.
180180 *
181+ * #GArrowFilterNodeOptions is a class to customize a filter node.
182+ *
181183 * #GArrowProjectNodeOptions is a class to customize a project node.
182184 *
183185 * #GArrowAggregation is a class to specify how to aggregate.
@@ -1059,6 +1061,41 @@ garrow_source_node_options_new_table(GArrowTable *table)
10591061}
10601062
10611063
1064+ G_DEFINE_TYPE (GArrowFilterNodeOptions,
1065+ garrow_filter_node_options,
1066+ GARROW_TYPE_EXECUTE_NODE_OPTIONS )
1067+
1068+ static void
1069+ garrow_filter_node_options_init(GArrowFilterNodeOptions *object)
1070+ {
1071+ }
1072+
1073+ static void
1074+ garrow_filter_node_options_class_init (GArrowFilterNodeOptionsClass *klass)
1075+ {
1076+ }
1077+
1078+ /* *
1079+ * garrow_filter_node_options_new:
1080+ * @expression: A #GArrowExpression to be used for filter.
1081+ *
1082+ * Returns: A newly created #GArrowFilterNodeOptions.
1083+ *
1084+ * Since: 12.0.0
1085+ */
1086+ GArrowFilterNodeOptions *
1087+ garrow_filter_node_options_new (GArrowExpression *expression)
1088+ {
1089+ auto arrow_expression = garrow_expression_get_raw (expression);
1090+ auto arrow_options =
1091+ new arrow::compute::FilterNodeOptions (*arrow_expression);
1092+ auto options = g_object_new (GARROW_TYPE_FILTER_NODE_OPTIONS ,
1093+ " options" , arrow_options,
1094+ NULL );
1095+ return GARROW_FILTER_NODE_OPTIONS (options);
1096+ }
1097+
1098+
10621099G_DEFINE_TYPE (GArrowProjectNodeOptions,
10631100 garrow_project_node_options,
10641101 GARROW_TYPE_EXECUTE_NODE_OPTIONS )
@@ -1871,6 +1908,39 @@ garrow_execute_plan_build_source_node(GArrowExecutePlan *plan,
18711908 error);
18721909}
18731910
1911+ /* *
1912+ * garrow_execute_plan_build_filter_node:
1913+ * @plan: A #GArrowExecutePlan.
1914+ * @input: A #GArrowExecuteNode.
1915+ * @options: A #GArrowFilterNodeOptions.
1916+ * @error: (nullable): Return location for a #GError or %NULL.
1917+ *
1918+ * This is a shortcut of garrow_execute_plan_build_node() for filter
1919+ * node.
1920+ *
1921+ * Returns: (transfer full): A newly built and added #GArrowExecuteNode
1922+ * for filter on success, %NULL on error.
1923+ *
1924+ * Since: 12.0.0
1925+ */
1926+ GArrowExecuteNode *
1927+ garrow_execute_plan_build_filter_node (GArrowExecutePlan *plan,
1928+ GArrowExecuteNode *input,
1929+ GArrowFilterNodeOptions *options,
1930+ GError **error)
1931+ {
1932+ GList *inputs = nullptr ;
1933+ inputs = g_list_prepend (inputs, input);
1934+ auto node =
1935+ garrow_execute_plan_build_node (plan,
1936+ " filter" ,
1937+ inputs,
1938+ GARROW_EXECUTE_NODE_OPTIONS (options),
1939+ error);
1940+ g_list_free (inputs);
1941+ return node;
1942+ }
1943+
18741944/* *
18751945 * garrow_execute_plan_build_project_node:
18761946 * @plan: A #GArrowExecutePlan.
0 commit comments