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

Update is_sorted to use experimental::row::lexicographic #12752

Merged

Conversation

divyegala
Copy link
Member

This PR is a part of #11844.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@divyegala divyegala added feature request New feature or request non-breaking Non-breaking change labels Feb 9, 2023
@divyegala divyegala requested a review from a team as a code owner February 9, 2023 21:46
@github-actions github-actions bot added the libcudf Affects libcudf (C++/CUDA) code. label Feb 9, 2023
Comment on lines +45 to +46
if (cudf::detail::has_nested_columns(in)) {
auto const device_comparator = comparator.less<true>(has_nested_nulls(in));
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if it's been discussed before, I feel it makes more sense to move this branching (whether has nested cols or not) into the comparator detail.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the way it was implemented for lexicographic::*_comparator, so I followed the convention. That said, there are some algorithms that dispatch different code-paths for nested and non-nested types already, so you want the granular level of control where those algorithms can select a particular version of the comparator

Copy link
Member

Choose a reason for hiding this comment

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

Understood. It's definitely out of the scope of this PR. But if we always dispatch different code-paths, the fine control of those algorithms seems unnecessary.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree. All of these if-statements scattered throughout the code seems like an anti-pattern we should try to factor out somehow. We should take a look once these are done. I'm also worried about compile time (surprise) and so that would be a reason to consider refactoring before these are complete perhaps.

Copy link
Member Author

Choose a reason for hiding this comment

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

I would prefer any refactor for design patterns to be a follow up to this #12593

Copy link
Member

@PointKernel PointKernel left a comment

Choose a reason for hiding this comment

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

LGTM

@divyegala
Copy link
Member Author

/merge

@rapids-bot rapids-bot bot merged commit 7190e33 into rapidsai:branch-23.04 Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants