You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "ZhangHuiGui (via GitHub)" <gi...@apache.org> on 2024/04/28 08:28:52 UTC
[PR] GH-41418: [C++] Add [Large]ListView and Map nested types for scalar_if_else's kernel functions [arrow]
ZhangHuiGui opened a new pull request, #41419:
URL: https://github.com/apache/arrow/pull/41419
<!--
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
Add [Large]ListView and Map nested types for scalar_if_else's kernel functions
<!--
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?
1. Add the list-view related types to `case_when`, `coalesce`'s kernel function and move the nested-types's added
logic to a unified function for better management.
2. Add the `MapType` and related test for `if_else`
<!--
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
3. 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-41418: [C++] Add [Large]ListView and Map nested types for scalar_if_else's kernel functions [arrow]
Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #41419:
URL: https://github.com/apache/arrow/pull/41419#issuecomment-2087983911
After merging your PR, Conbench analyzed the 7 benchmarking runs that have been run so far on merge-commit 0d7fac0d49eae7f139735c3e7c9256fc304a698a.
There were no benchmark performance regressions. 🎉
The [full Conbench report](https://github.com/apache/arrow/runs/24456613788) has more details. It also includes information about 23 possible false positives for unstable benchmarks that are known to sometimes produce them.
--
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-41418: [C++] Add [Large]ListView and Map nested types for scalar_if_else's kernel functions [arrow]
Posted by "ZhangHuiGui (via GitHub)" <gi...@apache.org>.
ZhangHuiGui commented on code in PR #41419:
URL: https://github.com/apache/arrow/pull/41419#discussion_r1584032992
##########
cpp/src/arrow/compute/kernels/scalar_if_else.cc:
##########
@@ -1807,7 +1808,8 @@ struct CaseWhenFunctor<Type, enable_if_base_binary<Type>> {
};
template <typename Type>
-struct CaseWhenFunctor<Type, enable_if_var_size_list<Type>> {
+struct CaseWhenFunctor<
+ Type, enable_if_t<is_base_list_type<Type>::value || is_list_view_type<Type>::value>> {
Review Comment:
> you can append the child values in any order and adjust the offset/size pairs of any random position to point to that area.
Thanks for your suggestion, i will dig into the list-view types.
> Feel free to copy and paste this class and enable_if it for `is_list_view` with a `TODO(GH-<issue number>): a more efficient implementation for list-views is possible` comment mentioning an issue you can create about this. Then we can tackle the optimization in a separate PR.
Agree!
--
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-41418: [C++] Add [Large]ListView and Map nested types for scalar_if_else's kernel functions [arrow]
Posted by "ZhangHuiGui (via GitHub)" <gi...@apache.org>.
ZhangHuiGui commented on code in PR #41419:
URL: https://github.com/apache/arrow/pull/41419#discussion_r1584064630
##########
cpp/src/arrow/compute/kernels/scalar_if_else.cc:
##########
@@ -1807,7 +1808,8 @@ struct CaseWhenFunctor<Type, enable_if_base_binary<Type>> {
};
template <typename Type>
-struct CaseWhenFunctor<Type, enable_if_var_size_list<Type>> {
+struct CaseWhenFunctor<
+ Type, enable_if_t<is_base_list_type<Type>::value || is_list_view_type<Type>::value>> {
Review Comment:
1. Optimization for list-view types in current thread will be tracked in https://github.com/apache/arrow/issues/41453 for optimize
2. The new commit includes a list-view type's benchmark for our performance regression in the future
--
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-41418: [C++] Add [Large]ListView and Map nested types for scalar_if_else's kernel functions [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #41419:
URL: https://github.com/apache/arrow/pull/41419#issuecomment-2081390526
:warning: GitHub issue #41418 **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-41418: [C++] Add [Large]ListView and Map nested types for scalar_if_else's kernel functions [arrow]
Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv merged PR #41419:
URL: https://github.com/apache/arrow/pull/41419
--
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-41418: [C++] Add [Large]ListView and Map nested types for scalar_if_else's kernel functions [arrow]
Posted by "ZhangHuiGui (via GitHub)" <gi...@apache.org>.
ZhangHuiGui commented on code in PR #41419:
URL: https://github.com/apache/arrow/pull/41419#discussion_r1584064630
##########
cpp/src/arrow/compute/kernels/scalar_if_else.cc:
##########
@@ -1807,7 +1808,8 @@ struct CaseWhenFunctor<Type, enable_if_base_binary<Type>> {
};
template <typename Type>
-struct CaseWhenFunctor<Type, enable_if_var_size_list<Type>> {
+struct CaseWhenFunctor<
+ Type, enable_if_t<is_base_list_type<Type>::value || is_list_view_type<Type>::value>> {
Review Comment:
1. Optimization for list-view types in current thread will be tracked in https://github.com/apache/arrow/issues/41453 for optimize
2. The new commit includes case_when's list-view type benchmark for our performance regression in the future
--
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-41418: [C++] Add [Large]ListView and Map nested types for scalar_if_else's kernel functions [arrow]
Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv commented on code in PR #41419:
URL: https://github.com/apache/arrow/pull/41419#discussion_r1583854772
##########
cpp/src/arrow/compute/kernels/scalar_if_else.cc:
##########
@@ -1807,7 +1808,8 @@ struct CaseWhenFunctor<Type, enable_if_base_binary<Type>> {
};
template <typename Type>
-struct CaseWhenFunctor<Type, enable_if_var_size_list<Type>> {
+struct CaseWhenFunctor<
+ Type, enable_if_t<is_base_list_type<Type>::value || is_list_view_type<Type>::value>> {
Review Comment:
The list-view types should have their own specialization because they have a super-power that classic list types don't have: you can append the child values in any order and adjust the offset/size pairs of any random position to point to that area.
Feel free to copy and paste this class and enable_if it for `is_list_view` with a `TODO(GH-<issue number>): a more efficient implementation for list-views is possible` comment mentioned an issue you can create about this. Then you can tackle the optimization in a separate PR.
--
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-41418: [C++] Add [Large]ListView and Map nested types for scalar_if_else's kernel functions [arrow]
Posted by "ZhangHuiGui (via GitHub)" <gi...@apache.org>.
ZhangHuiGui commented on code in PR #41419:
URL: https://github.com/apache/arrow/pull/41419#discussion_r1584064630
##########
cpp/src/arrow/compute/kernels/scalar_if_else.cc:
##########
@@ -1807,7 +1808,8 @@ struct CaseWhenFunctor<Type, enable_if_base_binary<Type>> {
};
template <typename Type>
-struct CaseWhenFunctor<Type, enable_if_var_size_list<Type>> {
+struct CaseWhenFunctor<
+ Type, enable_if_t<is_base_list_type<Type>::value || is_list_view_type<Type>::value>> {
Review Comment:
1. New issue for optimization list-view types: https://github.com/apache/arrow/issues/41453
2. New commit include a list-view type's benchmark for our performance regression in the future
--
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-41418: [C++] Add [Large]ListView and Map nested types for scalar_if_else's kernel functions [arrow]
Posted by "ZhangHuiGui (via GitHub)" <gi...@apache.org>.
ZhangHuiGui commented on PR #41419:
URL: https://github.com/apache/arrow/pull/41419#issuecomment-2081390638
cc @felipecrv PTAL this, thxs.
--
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-41418: [C++] Add [Large]ListView and Map nested types for scalar_if_else's kernel functions [arrow]
Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv commented on code in PR #41419:
URL: https://github.com/apache/arrow/pull/41419#discussion_r1583854772
##########
cpp/src/arrow/compute/kernels/scalar_if_else.cc:
##########
@@ -1807,7 +1808,8 @@ struct CaseWhenFunctor<Type, enable_if_base_binary<Type>> {
};
template <typename Type>
-struct CaseWhenFunctor<Type, enable_if_var_size_list<Type>> {
+struct CaseWhenFunctor<
+ Type, enable_if_t<is_base_list_type<Type>::value || is_list_view_type<Type>::value>> {
Review Comment:
The list-view types should have their own specialization because they have a super-power that classic list types don't have: you can append the child values in any order and adjust the offset/size pairs of any random position to point to that area.
Feel free to copy and paste this class and enable_if it for `is_list_view` with a `TODO(GH-<issue number>): a more efficient implementation for list-views is possible` comment mentioning an issue you can create about this. Then we can tackle the optimization in a separate PR.
--
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