kou commented on code in PR #48491:
URL: https://github.com/apache/arrow/pull/48491#discussion_r2656705672


##########
c_glib/arrow-glib/compute.cpp:
##########
@@ -10232,6 +10236,68 @@ garrow_week_options_new(void)
   return GARROW_WEEK_OPTIONS(g_object_new(GARROW_TYPE_WEEK_OPTIONS, nullptr));
 }
 
+G_DEFINE_TYPE(GArrowMakeStructOptions,
+              garrow_make_struct_options,
+              GARROW_TYPE_FUNCTION_OPTIONS)
+
+static void
+garrow_make_struct_options_init(GArrowMakeStructOptions *object)
+{
+  auto priv = GARROW_FUNCTION_OPTIONS_GET_PRIVATE(object);
+  priv->options = static_cast<arrow::compute::FunctionOptions *>(
+    new arrow::compute::MakeStructOptions());
+}
+
+static void
+garrow_make_struct_options_class_init(GArrowMakeStructOptionsClass *klass)
+{
+}
+
+/**
+ * garrow_make_struct_options_new:
+ *
+ * Returns: A newly created #GArrowMakeStructOptions.
+ *
+ * Since: 23.0.0
+ */
+GArrowMakeStructOptions *
+garrow_make_struct_options_new(void)
+{
+  auto options = g_object_new(GARROW_TYPE_MAKE_STRUCT_OPTIONS, NULL);
+  return GARROW_MAKE_STRUCT_OPTIONS(options);
+}
+
+/**
+ * garrow_make_struct_options_add_field:
+ * @options: A #GArrowMakeStructOptions.
+ * @name: The name of the field to add.
+ * @nullability: Whether the field is nullable.
+ * @metadata: (nullable) (element-type utf8 utf8): A #GHashTable for the 
field's
+ *   metadata, or %NULL.
+ *
+ * Adds a field to the struct options with the specified name, nullability,
+ * and optional metadata.
+ *
+ * Since: 23.0.0
+ */
+void
+garrow_make_struct_options_add_field(GArrowMakeStructOptions *options,
+                                     const char *name,
+                                     gboolean nullability,
+                                     GHashTable *metadata)
+{
+  auto arrow_options = static_cast<arrow::compute::MakeStructOptions *>(
+    garrow_function_options_get_raw(GARROW_FUNCTION_OPTIONS(options)));

Review Comment:
   Can we use `garrow_make_struct_options_get_raw()` here?
   
   ```suggestion
     auto arrow_options = garrow_make_struct_options_get_raw(options);
   ```



##########
c_glib/arrow-glib/compute.cpp:
##########
@@ -11600,3 +11671,21 @@ garrow_week_options_get_raw(GArrowWeekOptions *options)
   return static_cast<arrow::compute::WeekOptions *>(
     garrow_function_options_get_raw(GARROW_FUNCTION_OPTIONS(options)));
 }
+
+GArrowMakeStructOptions *
+garrow_make_struct_options_new_raw(const arrow::compute::MakeStructOptions 
*arrow_options)
+{
+  auto options =
+    GARROW_MAKE_STRUCT_OPTIONS(g_object_new(GARROW_TYPE_MAKE_STRUCT_OPTIONS, 
nullptr));
+  auto arrow_new_options = static_cast<arrow::compute::MakeStructOptions *>(
+    garrow_function_options_get_raw(GARROW_FUNCTION_OPTIONS(options)));

Review Comment:
   Can we use `garrow_make_struct_options_get_raw()` here?
   
   
   ```suggestion
     auto arrow_new_options = garrow_make_struct_options_get_raw(options);
   ```



##########
c_glib/arrow-glib/compute.cpp:
##########
@@ -10232,6 +10236,68 @@ garrow_week_options_new(void)
   return GARROW_WEEK_OPTIONS(g_object_new(GARROW_TYPE_WEEK_OPTIONS, nullptr));
 }
 
+G_DEFINE_TYPE(GArrowMakeStructOptions,
+              garrow_make_struct_options,
+              GARROW_TYPE_FUNCTION_OPTIONS)
+
+static void
+garrow_make_struct_options_init(GArrowMakeStructOptions *object)
+{
+  auto priv = GARROW_FUNCTION_OPTIONS_GET_PRIVATE(object);
+  priv->options = static_cast<arrow::compute::FunctionOptions *>(
+    new arrow::compute::MakeStructOptions());
+}
+
+static void
+garrow_make_struct_options_class_init(GArrowMakeStructOptionsClass *klass)
+{
+}
+
+/**
+ * garrow_make_struct_options_new:
+ *
+ * Returns: A newly created #GArrowMakeStructOptions.
+ *
+ * Since: 23.0.0
+ */
+GArrowMakeStructOptions *
+garrow_make_struct_options_new(void)
+{
+  auto options = g_object_new(GARROW_TYPE_MAKE_STRUCT_OPTIONS, NULL);

Review Comment:
   ```suggestion
     auto options = g_object_new(GARROW_TYPE_MAKE_STRUCT_OPTIONS, nullptr);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to