Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-41418: [C++] Add [Large]ListView and Map nested types for scalar_if_else's kernel functions #41419

Merged
merged 2 commits into from
Apr 30, 2024

Conversation

ZhangHuiGui
Copy link
Collaborator

@ZhangHuiGui ZhangHuiGui commented Apr 28, 2024

Rationale for this change

Add [Large]ListView and Map nested types for scalar_if_else's kernel functions

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

Are these changes tested?

Yes

Are there any user-facing changes?

No

Copy link

⚠️ GitHub issue #41418 has been automatically assigned in GitHub to PR creator.

@ZhangHuiGui
Copy link
Collaborator Author

cc @felipecrv PTAL this, thxs.

Comment on lines 1810 to 1812
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>> {
Copy link
Contributor

@felipecrv felipecrv Apr 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Copy link
Collaborator Author

@ZhangHuiGui ZhangHuiGui Apr 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Optimization for list-view types in current thread will be tracked in [C++] A more efficient "case_when" specialization for list-view types #41453 for optimize
  2. The new commit includes case_when's list-view type benchmark for our performance regression in the future

@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Apr 30, 2024
Copy link
Contributor

@felipecrv felipecrv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the benchmarks.

I'm waiting for some CI jobs I re-triggered, then I will merge.

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting change review Awaiting change review labels Apr 30, 2024
@felipecrv felipecrv merged commit 0d7fac0 into apache:main Apr 30, 2024
37 of 38 checks passed
@felipecrv felipecrv removed the awaiting merge Awaiting merge label Apr 30, 2024
Copy link

After merging your PR, Conbench analyzed the 7 benchmarking runs that have been run so far on merge-commit 0d7fac0.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 23 possible false positives for unstable benchmarks that are known to sometimes produce them.

tolleybot pushed a commit to tmct/arrow that referenced this pull request May 2, 2024
…alar_if_else's kernel functions (apache#41419)

### Rationale for this change
Add [Large]ListView and Map nested types for scalar_if_else's kernel functions

### 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`

### Are these changes tested?
Yes

### Are there any user-facing changes?
No

* GitHub Issue: apache#41418

Authored-by: ZhangHuiGui <[email protected]>
Signed-off-by: Felipe Oliveira Carvalho <[email protected]>
vibhatha pushed a commit to vibhatha/arrow that referenced this pull request May 25, 2024
…alar_if_else's kernel functions (apache#41419)

### Rationale for this change
Add [Large]ListView and Map nested types for scalar_if_else's kernel functions

### 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`

### Are these changes tested?
Yes

### Are there any user-facing changes?
No

* GitHub Issue: apache#41418

Authored-by: ZhangHuiGui <[email protected]>
Signed-off-by: Felipe Oliveira Carvalho <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants