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

Sort binary #569

Merged
merged 7 commits into from
Jul 26, 2021
Merged

Sort binary #569

merged 7 commits into from
Jul 26, 2021

Conversation

waynexia
Copy link
Member

Which issue does this PR close?

Closes #568.

What changes are included in this PR?

  • Extend take kernel to binary array family
  • Implement sort for binary array family
  • Unit test

@github-actions github-actions bot added the arrow Changes to the arrow crate label Jul 20, 2021
@waynexia waynexia marked this pull request as ready for review July 20, 2021 06:10
@codecov-commenter
Copy link

codecov-commenter commented Jul 20, 2021

Codecov Report

Merging #569 (5877bad) into master (1d6c374) will increase coverage by 0.07%.
The diff coverage is 98.55%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #569      +/-   ##
==========================================
+ Coverage   82.41%   82.49%   +0.07%     
==========================================
  Files         167      167              
  Lines       46257    46465     +208     
==========================================
+ Hits        38125    38331     +206     
- Misses       8132     8134       +2     
Impacted Files Coverage Δ
arrow/src/compute/kernels/sort.rs 94.69% <98.35%> (+0.54%) ⬆️
arrow/src/array/cast.rs 85.71% <100.00%> (+2.38%) ⬆️
arrow/src/compute/kernels/take.rs 94.91% <100.00%> (+0.18%) ⬆️
parquet/src/encodings/encoding.rs 95.04% <0.00%> (+0.19%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d6c374...5877bad. Read the comment docs.

Copy link
Contributor

@alamb alamb 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 @waynexia

I am not super familiar with the internals of list generic binary array, but I reviewed the tests you have added (thank you!) and they seem to demonstrate the correct behavior.

@nevi-me or @jorgecarleitao might you have some time to review this PR?

arrow/src/compute/kernels/sort.rs Show resolved Hide resolved
waynexia added 7 commits July 25, 2021 22:19
Signed-off-by: Ruihang Xia <[email protected]>
Signed-off-by: Ruihang Xia <[email protected]>
Signed-off-by: Ruihang Xia <[email protected]>
Signed-off-by: Ruihang Xia <[email protected]>
@alamb
Copy link
Contributor

alamb commented Jul 26, 2021

Unless I hear anything else I plan to merge this later today or tomorrow

@alamb alamb merged commit 2113e2b into apache:master Jul 26, 2021
@alamb
Copy link
Contributor

alamb commented Jul 26, 2021

Thanks again @waynexia 🚀

@waynexia
Copy link
Member Author

Appreciate it @alamb!

@waynexia waynexia deleted the sort_binary branch July 27, 2021 00:59
@alamb
Copy link
Contributor

alamb commented Jul 27, 2021

BTW @waynexia I expect this change to be available in arrow 5.1.0 (scheduled for release at the end of this week or early next week)

alamb pushed a commit that referenced this pull request Jul 27, 2021
* impl sort fixed binary array

Signed-off-by: Ruihang Xia <[email protected]>

* remove array builder util, add test cases

Signed-off-by: Ruihang Xia <[email protected]>

* impl sort for generic binary array

Signed-off-by: Ruihang Xia <[email protected]>

* tidy

Signed-off-by: Ruihang Xia <[email protected]>

* run clippy

Signed-off-by: Ruihang Xia <[email protected]>

* test: fixed binary with different prefix

Signed-off-by: Ruihang Xia <[email protected]>

* rebase master

Signed-off-by: Ruihang Xia <[email protected]>
@waynexia
Copy link
Member Author

Sure! I'd like to help.

It seems that changes in #552 make the cherry-pick PR's CI failed. I think #552 should be cherry-picked first.

However, #552 changes the default behavior (from stable sort to unstable version). So if ship #552 in a minor release is not expected, I can submit a patch to make #621 pass CI.

@waynexia
Copy link
Member Author

Ahh, I noticed #573 which already gives a try.

May I ask which way should I add changes to #621? Add commits to branch cherry_pick_2113e2b1 (if I can) or file a new PR.

@alamb
Copy link
Contributor

alamb commented Jul 27, 2021

Thank you very much @waynexia !

May I ask which way should I add changes to #621? Add commits to branch cherry_pick_2113e2b1 (if I can) or file a new PR.

I think a new PR would be best (feel free to base it off of cherry_pick_2113e2b1) so that it is clear what is happening

@waynexia
Copy link
Member Author

Got it, I opened #624 😃

alamb added a commit that referenced this pull request Jul 29, 2021
* Sort binary (#569)

* impl sort fixed binary array

Signed-off-by: Ruihang Xia <[email protected]>

* remove array builder util, add test cases

Signed-off-by: Ruihang Xia <[email protected]>

* impl sort for generic binary array

Signed-off-by: Ruihang Xia <[email protected]>

* tidy

Signed-off-by: Ruihang Xia <[email protected]>

* run clippy

Signed-off-by: Ruihang Xia <[email protected]>

* test: fixed binary with different prefix

Signed-off-by: Ruihang Xia <[email protected]>

* rebase master

Signed-off-by: Ruihang Xia <[email protected]>

* Fix compile error in cherry pick 2113e2b (#624)

Signed-off-by: Ruihang Xia <[email protected]>

Co-authored-by: Ruihang Xia <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement sort() for binary array
3 participants