You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "hiroyuki-sato (via GitHub)" <gi...@apache.org> on 2024/11/06 10:05:34 UTC
[PR] GH-44656: [GLib] Add GArrowBinaryViewDataType [arrow]
hiroyuki-sato opened a new pull request, #44659:
URL: https://github.com/apache/arrow/pull/44659
<!--
Thanks for opening a pull request!
If this is your first pull request you can find detailed information on how
to contribute here:
* [New Contributor's Guide](https://arrow.apache.org/docs/dev/developers/guide/step_by_step/pr_lifecycle.html#reviews-and-merge-of-the-pull-request)
* [Contributing Overview](https://arrow.apache.org/docs/dev/developers/overview.html)
If this is not a [minor PR](https://github.com/apache/arrow/blob/main/CONTRIBUTING.md#Minor-Fixes). Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose
Opening GitHub issues ahead of time contributes to the [Openness](http://theapacheway.com/open/#:~:text=Openness%20allows%20new%20users%20the,must%20happen%20in%20the%20open.) of the Apache Arrow project.
Then could you also rename the pull request title in the following format?
GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
or
MINOR: [${COMPONENT}] ${SUMMARY}
In the case of PARQUET issues on JIRA the title also supports:
PARQUET-${JIRA_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
-->
### Rationale for this change
The `arrow::BinaryViewType` has been introduced.
GLib needs to be implemented as the `GArrowBinaryViewDataType`.
<!--
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
-->
### What changes are included in this PR?
Implement `GArrowBinaryViewDataType`.
<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
-->
### Are these changes tested?
YES
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
-->
### Are there any user-facing changes?
NO
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please uncomment the line below and explain which changes are breaking.
-->
<!-- **This PR includes breaking changes to public APIs.** -->
<!--
Please uncomment the line below (and provide explanation) if the changes fix either (a) a security vulnerability, (b) a bug that caused incorrect or invalid data to be produced, or (c) a bug that causes a crash (even when the API contract is upheld). We use this to highlight fixes to issues that may affect users without their knowledge. For this reason, fixing bugs that cause errors don't count, since those are usually obvious.
-->
<!-- **This PR contains a "Critical Fix".** -->
--
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
Re: [PR] GH-44656: [GLib] Add GArrowBinaryViewDataType [arrow]
Posted by "hiroyuki-sato (via GitHub)" <gi...@apache.org>.
hiroyuki-sato commented on code in PR #44659:
URL: https://github.com/apache/arrow/pull/44659#discussion_r1831894502
##########
c_glib/arrow-glib/type.h:
##########
@@ -116,7 +118,10 @@ typedef enum {
GARROW_TYPE_LARGE_LIST,
GARROW_TYPE_MONTH_DAY_NANO_INTERVAL,
GARROW_TYPE_RUN_END_ENCODED,
- /* TODO: Remove = 43 when we add STRING_VIEW(39)..LARGE_LIST_VIEW(42). */
+ GARROW_TYPE_STRING_VIEW,
Review Comment:
Thanks Removed.
--
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
Re: [PR] GH-44656: [GLib] Add GArrowBinaryViewDataType [arrow]
Posted by "hiroyuki-sato (via GitHub)" <gi...@apache.org>.
hiroyuki-sato commented on code in PR #44659:
URL: https://github.com/apache/arrow/pull/44659#discussion_r1831894041
##########
c_glib/arrow-glib/basic-data-type.h:
##########
@@ -418,6 +418,22 @@ struct _GArrowTemporalDataTypeClass
GArrowFixedWidthDataTypeClass parent_class;
};
+#define GARROW_TYPE_BINARY_VIEW_DATA_TYPE (garrow_binary_view_data_type_get_type())
Review Comment:
Thanks. moved to the bottom (inside `G_BEGIN_DECL`/`G_END_DECL`)
--
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
Re: [PR] GH-44656: [GLib] Add GArrowBinaryViewDataType [arrow]
Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #44659:
URL: https://github.com/apache/arrow/pull/44659#discussion_r1831951051
##########
c_glib/arrow-glib/type.h:
##########
@@ -70,6 +70,8 @@ G_BEGIN_DECLS
* @GARROW_TYPE_LARGE_LIST: A list of some logical data type with 64-bit offsets.
* @GARROW_TYPE_MONTH_DAY_NANO_INTERVAL: MONTH_DAY_NANO interval in SQL style.
* @GARROW_TYPE_RUN_END_ENCODED: Run-end encoded data.
+ * @GARROW_TYPE_BINARY_VIEW: Bytes view type with 4-byte prefix and inline small string
+ * optimization.
Review Comment:
```suggestion
* optimization.
```
--
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
Re: [PR] GH-44656: [GLib] Add GArrowBinaryViewDataType [arrow]
Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #44659:
URL: https://github.com/apache/arrow/pull/44659#discussion_r1830759019
##########
c_glib/arrow-glib/basic-data-type.cpp:
##########
@@ -813,6 +815,35 @@ garrow_binary_data_type_new(void)
return data_type;
}
+G_DEFINE_TYPE(GArrowBinaryViewDataType,
+ garrow_binary_view_data_type,
+ GARROW_TYPE_DATA_TYPE)
+
+static void
+garrow_binary_view_data_type_init(GArrowBinaryViewDataType *object)
+{
+}
+
+static void
+garrow_binary_view_data_type_class_init(GArrowBinaryViewDataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_binary_view_data_type_new:
+ *
+ * Returns: The newly created binary view data type.
+ */
+GArrowBinaryViewDataType *
+garrow_binary_view_data_type_new(void)
+{
+ auto arrow_data_type = arrow::binary_view();
+
Review Comment:
```suggestion
```
##########
c_glib/arrow-glib/basic-data-type.cpp:
##########
@@ -69,6 +69,8 @@ G_BEGIN_DECLS
*
* #GArrowBinaryDataType is a class for the binary data type.
*
+ * #GArrowBinaryViewDataType is a class for the binary data type.
Review Comment:
```suggestion
* #GArrowBinaryViewDataType is a class for the binary view data type.
```
Anyway, could you move this to https://github.com/apache/arrow/blob/40b2fca4742e2692a917755fd8db2939e10fa02d/c_glib/arrow-glib/basic-data-type.cpp#L130 ?
##########
c_glib/arrow-glib/basic-data-type.h:
##########
@@ -418,6 +418,22 @@ struct _GArrowTemporalDataTypeClass
GArrowFixedWidthDataTypeClass parent_class;
};
+#define GARROW_TYPE_BINARY_VIEW_DATA_TYPE (garrow_binary_view_data_type_get_type())
+GARROW_AVAILABLE_IN_19_0
+G_DECLARE_DERIVABLE_TYPE(GArrowBinaryViewDataType,
+ garrow_binary_view_data_type,
+ GARROW,
+ BINARY_VIEW_DATA_TYPE,
+ GArrowDataType)
+struct _GArrowBinaryViewDataTypeClass
+{
+ GArrowDataTypeClass parent_class;
+};
+
+GARROW_AVAILABLE_IN_19_0
+GArrowBinaryViewDataType *
+garrow_binary_view_data_type_new(void);
Review Comment:
Could you move this to https://github.com/apache/arrow/blob/40b2fca4742e2692a917755fd8db2939e10fa02d/c_glib/arrow-glib/basic-data-type.h#L772 ?
--
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
Re: [PR] GH-44656: [GLib] Add GArrowBinaryViewDataType [arrow]
Posted by "hiroyuki-sato (via GitHub)" <gi...@apache.org>.
hiroyuki-sato commented on code in PR #44659:
URL: https://github.com/apache/arrow/pull/44659#discussion_r1830903587
##########
c_glib/arrow-glib/basic-data-type.h:
##########
@@ -418,6 +418,22 @@ struct _GArrowTemporalDataTypeClass
GArrowFixedWidthDataTypeClass parent_class;
};
+#define GARROW_TYPE_BINARY_VIEW_DATA_TYPE (garrow_binary_view_data_type_get_type())
Review Comment:
Should I move this definition to the bottom? (Just in case)
##########
c_glib/arrow-glib/basic-data-type.cpp:
##########
@@ -69,6 +69,8 @@ G_BEGIN_DECLS
*
* #GArrowBinaryDataType is a class for the binary data type.
*
+ * #GArrowBinaryViewDataType is a class for the binary data type.
Review Comment:
Thanks! Fixed.
##########
c_glib/arrow-glib/basic-data-type.cpp:
##########
@@ -813,6 +815,35 @@ garrow_binary_data_type_new(void)
return data_type;
}
+G_DEFINE_TYPE(GArrowBinaryViewDataType,
+ garrow_binary_view_data_type,
+ GARROW_TYPE_DATA_TYPE)
+
+static void
+garrow_binary_view_data_type_init(GArrowBinaryViewDataType *object)
+{
+}
+
+static void
+garrow_binary_view_data_type_class_init(GArrowBinaryViewDataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_binary_view_data_type_new:
+ *
+ * Returns: The newly created binary view data type.
+ */
+GArrowBinaryViewDataType *
+garrow_binary_view_data_type_new(void)
+{
+ auto arrow_data_type = arrow::binary_view();
+
Review Comment:
Thanks Fixed.
##########
c_glib/arrow-glib/basic-data-type.h:
##########
@@ -418,6 +418,22 @@ struct _GArrowTemporalDataTypeClass
GArrowFixedWidthDataTypeClass parent_class;
};
+#define GARROW_TYPE_BINARY_VIEW_DATA_TYPE (garrow_binary_view_data_type_get_type())
+GARROW_AVAILABLE_IN_19_0
+G_DECLARE_DERIVABLE_TYPE(GArrowBinaryViewDataType,
+ garrow_binary_view_data_type,
+ GARROW,
+ BINARY_VIEW_DATA_TYPE,
+ GArrowDataType)
+struct _GArrowBinaryViewDataTypeClass
+{
+ GArrowDataTypeClass parent_class;
+};
+
+GARROW_AVAILABLE_IN_19_0
+GArrowBinaryViewDataType *
+garrow_binary_view_data_type_new(void);
Review Comment:
Thanks. moved.
--
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
Re: [PR] GH-44656: [GLib] Add GArrowBinaryViewDataType [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #44659:
URL: https://github.com/apache/arrow/pull/44659#issuecomment-2459192097
:warning: GitHub issue #44656 **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
Re: [PR] GH-44656: [GLib] Add GArrowBinaryViewDataType [arrow]
Posted by "kou (via GitHub)" <gi...@apache.org>.
kou merged PR #44659:
URL: https://github.com/apache/arrow/pull/44659
--
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
Re: [PR] GH-44656: [GLib] Add GArrowBinaryViewDataType [arrow]
Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #44659:
URL: https://github.com/apache/arrow/pull/44659#discussion_r1831715971
##########
c_glib/arrow-glib/type.h:
##########
@@ -116,7 +118,10 @@ typedef enum {
GARROW_TYPE_LARGE_LIST,
GARROW_TYPE_MONTH_DAY_NANO_INTERVAL,
GARROW_TYPE_RUN_END_ENCODED,
- /* TODO: Remove = 43 when we add STRING_VIEW(39)..LARGE_LIST_VIEW(42). */
+ GARROW_TYPE_STRING_VIEW,
Review Comment:
Could you add this when we add support string view data type?
```suggestion
```
--
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
Re: [PR] GH-44656: [GLib] Add GArrowBinaryViewDataType [arrow]
Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #44659:
URL: https://github.com/apache/arrow/pull/44659#discussion_r1831714365
##########
c_glib/arrow-glib/basic-data-type.h:
##########
@@ -418,6 +418,22 @@ struct _GArrowTemporalDataTypeClass
GArrowFixedWidthDataTypeClass parent_class;
};
+#define GARROW_TYPE_BINARY_VIEW_DATA_TYPE (garrow_binary_view_data_type_get_type())
Review Comment:
Yes.
`#define GARROW_TYPE_...` should be near the related `G_DECLARE_DERIVABLE_TYPE()` and so on.
--
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
Re: [PR] GH-44656: [GLib] Add GArrowBinaryViewDataType [arrow]
Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #44659:
URL: https://github.com/apache/arrow/pull/44659#issuecomment-2461887560
After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit ac6b8ffc6a34e490a51760175313f06c99bccdbd.
There were no benchmark performance regressions. 🎉
The [full Conbench report](https://github.com/apache/arrow/runs/32648437249) 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