felipecrv commented on code in PR #36470:
URL: https://github.com/apache/arrow/pull/36470#discussion_r1253124041
##########
c_glib/arrow-glib/composite-array.cpp:
##########
@@ -59,7 +59,15 @@ G_BEGIN_DECLS
* #GArrowDictionaryArray is a class for dictionary array. It can
* store data with dictionary and indices. It's space effective than
* normal array when the array has many same values. You can convert a
- * normal array to dictionary array by garrow_array_dictionary_encode().
+ * normal array to a dictionary array by
+ * garrow_array_dictionary_encode().
+ *
+ * #GArrowRunEndEncodedArray is a class for run-end encoded array. It
+ * can store data with run-ends and values. It's space effective than
Review Comment:
missing "more"? `It's [more] space effective`
##########
c_glib/arrow-glib/composite-array.cpp:
##########
@@ -1760,4 +1768,330 @@
garrow_dictionary_array_get_dictionary_data_type(GArrowDictionaryArray *array)
return GARROW_DICTIONARY_DATA_TYPE(data_type);
}
+
+struct GArrowRunEndEncodedArrayPrivate {
+ GArrowArray *run_ends;
+ GArrowArray *values;
+};
+
+enum {
+ PROP_RUN_ENDS = 1,
+ PROP_VALUES,
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE(GArrowRunEndEncodedArray,
+ garrow_run_end_encoded_array,
+ GARROW_TYPE_ARRAY)
+
+#define GARROW_RUN_END_ENCODED_ARRAY_GET_PRIVATE(obj) \
+ static_cast<GArrowRunEndEncodedArrayPrivate *>( \
+ garrow_run_end_encoded_array_get_instance_private( \
+ GARROW_RUN_END_ENCODED_ARRAY(obj)))
+
+static void
+garrow_run_end_encoded_array_dispose(GObject *object)
+{
+ auto priv = GARROW_RUN_END_ENCODED_ARRAY_GET_PRIVATE(object);
+
+ if (priv->run_ends) {
+ g_object_unref(priv->run_ends);
+ priv->run_ends = nullptr;
+ }
+
+ if (priv->values) {
+ g_object_unref(priv->values);
+ priv->values = nullptr;
+ }
+
+ G_OBJECT_CLASS(garrow_run_end_encoded_array_parent_class)->dispose(object);
+}
+
+static void
+garrow_run_end_encoded_array_set_property(GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ auto priv = GARROW_RUN_END_ENCODED_ARRAY_GET_PRIVATE(object);
+
+ switch (prop_id) {
+ case PROP_RUN_ENDS:
+ priv->run_ends = GARROW_ARRAY(g_value_dup_object(value));
+ break;
+ case PROP_VALUES:
+ priv->values = GARROW_ARRAY(g_value_dup_object(value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+garrow_run_end_encoded_array_get_property(GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ auto priv = GARROW_RUN_END_ENCODED_ARRAY_GET_PRIVATE(object);
+
+ switch (prop_id) {
+ case PROP_RUN_ENDS:
+ g_value_set_object(value, priv->run_ends);
+ break;
+ case PROP_VALUES:
+ g_value_set_object(value, priv->values);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+garrow_run_end_encoded_array_init(GArrowRunEndEncodedArray *object)
+{
+}
Review Comment:
A no-op on purpose?
--
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]