You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "viirya (via GitHub)" <gi...@apache.org> on 2024/02/26 03:35:02 UTC

[PR] feat: Add dictionary binary to shuffle writer [arrow-datafusion-comet]

viirya opened a new pull request, #111:
URL: https://github.com/apache/arrow-datafusion-comet/pull/111

   ## Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #.
   
   ## Rationale for this change
   
   <!--
    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?
   
   <!--
   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.
   -->
   
   ## How are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. 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)?
   -->
   


-- 
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] feat: Add dictionary binary to shuffle writer [arrow-datafusion-comet]

Posted by "viirya (via GitHub)" <gi...@apache.org>.
viirya commented on PR #111:
URL: https://github.com/apache/arrow-datafusion-comet/pull/111#issuecomment-1965572236

   Merged. Thanks.


-- 
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] feat: Add dictionary binary to shuffle writer [arrow-datafusion-comet]

Posted by "viirya (via GitHub)" <gi...@apache.org>.
viirya commented on code in PR #111:
URL: https://github.com/apache/arrow-datafusion-comet/pull/111#discussion_r1502105420


##########
core/src/execution/datafusion/spark_hash.rs:
##########
@@ -292,6 +292,12 @@ pub fn create_hashes<'a>(
             DataType::LargeUtf8 => {
                 hash_array!(LargeStringArray, col, hashes_buffer);
             }
+            DataType::Binary => {

Review Comment:
   I remember `spark_compatible_murmur3_hash` is implemented following Spark shuffle's hash function.



-- 
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] feat: Add dictionary binary to shuffle writer [arrow-datafusion-comet]

Posted by "viirya (via GitHub)" <gi...@apache.org>.
viirya merged PR #111:
URL: https://github.com/apache/arrow-datafusion-comet/pull/111


-- 
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] feat: Add dictionary binary to shuffle writer [arrow-datafusion-comet]

Posted by "advancedxy (via GitHub)" <gi...@apache.org>.
advancedxy commented on code in PR #111:
URL: https://github.com/apache/arrow-datafusion-comet/pull/111#discussion_r1502092718


##########
core/src/execution/datafusion/shuffle_writer.rs:
##########
@@ -460,32 +460,32 @@ fn append_columns(
         };
     }
 
-    macro_rules! append_string_dict {
-        ($kt:ident) => {{
+    macro_rules! append_byte_dict {
+        ($kt:ident, $byte_type:ty, $array:ty) => {{

Review Comment:
   how about `$array -> $array_type`?



##########
core/src/execution/datafusion/spark_hash.rs:
##########
@@ -292,6 +292,12 @@ pub fn create_hashes<'a>(
             DataType::LargeUtf8 => {
                 hash_array!(LargeStringArray, col, hashes_buffer);
             }
+            DataType::Binary => {

Review Comment:
   Just to confirm, this is for equal/hash contract for Spark side's sort operations?
   
   I noticed some error when testing.



##########
core/src/execution/datafusion/shuffle_writer.rs:
##########
@@ -1098,47 +1113,47 @@ fn make_dict_builder(datatype: &DataType, capacity: usize) -> Box<dyn ArrayBuild
             if matches!(value_type.as_ref(), DataType::LargeUtf8) =>
         {
             match key_type.as_ref() {
-                DataType::Int8 => string_dict_builder_inner_helper!(
-                    Int16Type,
+                DataType::Int8 => byte_dict_builder_inner_helper!(
+                    Int8Type,

Review Comment:
   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.



-- 
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] feat: Add dictionary binary to shuffle writer [arrow-datafusion-comet]

Posted by "viirya (via GitHub)" <gi...@apache.org>.
viirya commented on code in PR #111:
URL: https://github.com/apache/arrow-datafusion-comet/pull/111#discussion_r1502107272


##########
core/src/execution/datafusion/shuffle_writer.rs:
##########
@@ -1098,47 +1113,47 @@ fn make_dict_builder(datatype: &DataType, capacity: usize) -> Box<dyn ArrayBuild
             if matches!(value_type.as_ref(), DataType::LargeUtf8) =>
         {
             match key_type.as_ref() {
-                DataType::Int8 => string_dict_builder_inner_helper!(
-                    Int16Type,
+                DataType::Int8 => byte_dict_builder_inner_helper!(
+                    Int8Type,

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



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