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

feat: Add dictionary binary to shuffle writer #111

Merged
merged 3 commits into from
Feb 27, 2024

Conversation

viirya
Copy link
Member

@viirya viirya commented Feb 26, 2024

Which issue does this PR close?

Closes #114.

Rationale for this change

Native shuffle writer can write dictionary of string but dictionary of binary is not supported. We should add it.

What changes are included in this PR?

Adding the support of dictionary of binary to native shuffle writer.

How are these changes tested?

@viirya viirya force-pushed the dictionary_binary_shuffle branch from bc34bb5 to 7d942b5 Compare February 26, 2024 04:52
Copy link
Contributor

@advancedxy advancedxy left a comment

Choose a reason for hiding this comment

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

Generally lgtm, except some minor comments, which are optional.

core/src/execution/datafusion/shuffle_writer.rs Outdated Show resolved Hide resolved
DataType::Int8 => string_dict_builder_inner_helper!(
Int16Type,
DataType::Int8 => byte_dict_builder_inner_helper!(
Int8Type,
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a bug fixes? It looks like we may lack some unit test coverage in the rust side.

Maybe we should add more unit tests in the rust side in the follow-up PRs.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea, it is a typo. More test coverage is good. As there are too many combinations, we probably miss some in current test coverage.

@@ -292,6 +292,12 @@ pub fn create_hashes<'a>(
DataType::LargeUtf8 => {
hash_array!(LargeStringArray, col, hashes_buffer);
}
DataType::Binary => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to confirm, this is for equal/hash contract for Spark side's sort operations?

I noticed some error when testing.

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 remember spark_compatible_murmur3_hash is implemented following Spark shuffle's hash function.

Copy link
Member

@sunchao sunchao left a comment

Choose a reason for hiding this comment

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

LGTM

@viirya viirya merged commit 9cfe96f into apache:main Feb 27, 2024
15 checks passed
@viirya
Copy link
Member Author

viirya commented Feb 27, 2024

Merged. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add dictionary binary to shuffle writer
3 participants