You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "kou (via GitHub)" <gi...@apache.org> on 2023/07/05 07:09:59 UTC
[GitHub] [arrow] kou opened a new pull request, #36470: GH-35418: [GLib] Add GArrowRunEndEncodedArray
kou opened a new pull request, #36470:
URL: https://github.com/apache/arrow/pull/36470
### Rationale for this change
`arrow::RunEndEncodedArray` is available since Apache Arrow C++ 12. Apache Arrow GLib should support it.
### What changes are included in this PR?
Add `GArrowRunEndEncodedArray` as the binding of `arrow::RunEndEncodedArray`.
`garrow_array_run_end_encode()` and `garrow_run_end_encoded_array_decode()` are also added.
### Are these changes tested?
Yes.
### Are there any user-facing changes?
Yes.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] kou commented on a diff in pull request #36470: GH-35418: [GLib] Add GArrowRunEndEncodedArray
Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #36470:
URL: https://github.com/apache/arrow/pull/36470#discussion_r1253853202
##########
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:
Thanks for the wording suggestion! (I'm not a native English speaker.)
I've added "more".
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] kou commented on a diff in pull request #36470: GH-35418: [GLib] Add GArrowRunEndEncodedArray
Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #36470:
URL: https://github.com/apache/arrow/pull/36470#discussion_r1253854089
##########
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:
Yes.
This is a constructor in the GObject world. And all classes must have a constructor.
We don't have anything to do for `GArrowRunEndEncodedArray` in a constructor. So this is a no-op function.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] felipecrv commented on a diff in pull request #36470: GH-35418: [GLib] Add GArrowRunEndEncodedArray
Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] github-actions[bot] commented on pull request #36470: GH-35418: [GLib] Add GArrowRunEndEncodedArray
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #36470:
URL: https://github.com/apache/arrow/pull/36470#issuecomment-1621161346
:warning: GitHub issue #35418 **has been automatically assigned in GitHub** to PR creator.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] kou merged pull request #36470: GH-35418: [GLib] Add GArrowRunEndEncodedArray
Posted by "kou (via GitHub)" <gi...@apache.org>.
kou merged PR #36470:
URL: https://github.com/apache/arrow/pull/36470
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] conbench-apache-arrow[bot] commented on pull request #36470: GH-35418: [GLib] Add GArrowRunEndEncodedArray
Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #36470:
URL: https://github.com/apache/arrow/pull/36470#issuecomment-1635605258
Conbench analyzed the 6 benchmark runs on commit `0340c76d`.
There was 1 benchmark result indicating a performance regression:
- Commit Run on `ursa-thinkcentre-m75q` at [2023-07-11 08:14:06Z](http://conbench.ursa.dev/compare/runs/d91817f4a09d40359160b14b180aa964...2cdc6399ea904cc9b6b04101738ebbbc/)
- [params=1024, source=cpp-micro, suite=parquet-encoding-benchmark](http://conbench.ursa.dev/compare/benchmarks/064ace23c72976bf8000764380aa3a1f...064ad0fb7f2c7f368000d1d83faf540f)
The [full Conbench report](https://github.com/apache/arrow/runs/15041213743) has more details.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org