You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2023/01/09 12:03:17 UTC

[GitHub] [arrow-rs] crepererum opened a new pull request, #3498: fix: bool IPC

crepererum opened a new pull request, #3498:
URL: https://github.com/apache/arrow-rs/pull/3498

   # Which issue does this PR close?
   Closes #3496.
   
   # Rationale for this change
   It seems that the IPC writer doesn't correctly account for sliced boolean columns. See #3496.
   
   # What changes are included in this PR?
   New IPC writer routine for bools that shifts data correctly + tests.
   
   # Are there any user-facing changes?
   IPC for bools no longer broken.


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


[GitHub] [arrow-rs] crepererum commented on a diff in pull request #3498: fix: bool IPC

Posted by GitBox <gi...@apache.org>.
crepererum commented on code in PR #3498:
URL: https://github.com/apache/arrow-rs/pull/3498#discussion_r1064908133


##########
arrow-ipc/src/writer.rs:
##########
@@ -1231,6 +1231,38 @@ fn write_array_data(
                 compression_codec,
             )?;
         }
+    } else if matches!(data_type, DataType::Boolean) {
+        // Bools are special because the payload (= 1 bit) is smaller than the physical container elements (= bytes).
+        // The array data may not start at the physical boundary of the underlying buffer, so we need to shift bits around.
+        assert!(array_data.buffers().len() == 1);
+        let buffer = &array_data.buffers()[0];

Review Comment:
   Ah nice, didn't know that this existed. Fixed.



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


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3498: fix: bool IPC

Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #3498:
URL: https://github.com/apache/arrow-rs/pull/3498#discussion_r1064868099


##########
arrow-ipc/src/writer.rs:
##########
@@ -1231,6 +1231,38 @@ fn write_array_data(
                 compression_codec,
             )?;
         }
+    } else if matches!(data_type, DataType::Boolean) {
+        // Bools are special because the payload (= 1 bit) is smaller than the physical container elements (= bytes).
+        // The array data may not start at the physical boundary of the underlying buffer, so we need to shift bits around.
+        assert!(array_data.buffers().len() == 1);
+        let buffer = &array_data.buffers()[0];

Review Comment:
   Could we use Buffer::bit_slice here?



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


[GitHub] [arrow-rs] ursabot commented on pull request #3498: Fix IPCWriter for Sliced BooleanArray

Posted by GitBox <gi...@apache.org>.
ursabot commented on PR #3498:
URL: https://github.com/apache/arrow-rs/pull/3498#issuecomment-1377224125

   Benchmark runs are scheduled for baseline = fb36dd980b398deabe5547af114982326b97e078 and contender = cada9ba33803a48a3145ab333fe1cf6410999d89. cada9ba33803a48a3145ab333fe1cf6410999d89 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/98fb0125f2fa4a90ac771613696efdd1...f6c59f2e063c42beacc62bed4307facb/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/a5081adbdf8c49ce8b208de98f7890c2...835b0cb4305d4db9bfa3fb65550c5bd3/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/5c2a7e0ad00d4a909c0763a85c65fc69...770676c54b0a499590b68ab8f18130ac/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/9a9d04e866824bcd84d91688ccbb8a50...7e83c45f29d24706829296626db52130/)
   Buildkite builds:
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


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


[GitHub] [arrow-rs] tustvold merged pull request #3498: Fix IPCWriter for Sliced BooleanArray

Posted by GitBox <gi...@apache.org>.
tustvold merged PR #3498:
URL: https://github.com/apache/arrow-rs/pull/3498


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


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3498: fix: bool IPC

Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #3498:
URL: https://github.com/apache/arrow-rs/pull/3498#discussion_r1065043641


##########
arrow-ipc/src/writer.rs:
##########
@@ -1231,6 +1231,14 @@ fn write_array_data(
                 compression_codec,
             )?;
         }
+    } else if matches!(data_type, DataType::Boolean) {
+        // Bools are special because the payload (= 1 bit) is smaller than the physical container elements (= bytes).
+        // The array data may not start at the physical boundary of the underlying buffer, so we need to shift bits around.
+        assert!(array_data.buffers().len() == 1);

Review Comment:
   Assert_eq?



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


[GitHub] [arrow-rs] crepererum commented on a diff in pull request #3498: Fix IPCWriter for Sliced BooleanArray

Posted by GitBox <gi...@apache.org>.
crepererum commented on code in PR #3498:
URL: https://github.com/apache/arrow-rs/pull/3498#discussion_r1065690010


##########
arrow-ipc/src/writer.rs:
##########
@@ -1231,6 +1231,14 @@ fn write_array_data(
                 compression_codec,
             )?;
         }
+    } else if matches!(data_type, DataType::Boolean) {
+        // Bools are special because the payload (= 1 bit) is smaller than the physical container elements (= bytes).
+        // The array data may not start at the physical boundary of the underlying buffer, so we need to shift bits around.
+        assert!(array_data.buffers().len() == 1);

Review Comment:
   done



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