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/10/27 17:38:07 UTC

[PR] doc: Clarify take kernel behavior [arrow-rs]

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

   # 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.
   -->
   
   # Are there any user-facing changes?
   
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!---
   If there are any breaking changes to public APIs, please add the `breaking change` label.
   -->
   


-- 
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] doc: Clarify take kernel semantics [arrow-rs]

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold merged PR #6632:
URL: https://github.com/apache/arrow-rs/pull/6632


-- 
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] doc: Clarify take kernel semantics [arrow-rs]

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

   Thanks @Dandandan @tustvold 


-- 
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] doc: Clarify take kernel semantics [arrow-rs]

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


##########
arrow-select/src/take.rs:
##########
@@ -50,6 +50,12 @@ use num::{One, Zero};
 ///
 /// For selecting values by index from multiple arrays see [`crate::interleave`]
 ///
+/// Note that the semantics of this kernel ("take" elements) is reflected on the output
+/// values. The corresponding elements in the output array are the elements in the input
+/// array at the indices specified in the indices array. This kernel, similar to other
+/// kernels in this crate, does not guarantee that it creates new buffers or takes/reuses
+/// existing buffers from the input arrays.

Review Comment:
   Okay



-- 
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] doc: Clarify take kernel semantics [arrow-rs]

Posted by "Dandandan (via GitHub)" <gi...@apache.org>.
Dandandan commented on code in PR #6632:
URL: https://github.com/apache/arrow-rs/pull/6632#discussion_r1818171776


##########
arrow-select/src/take.rs:
##########
@@ -50,6 +50,12 @@ use num::{One, Zero};
 ///
 /// For selecting values by index from multiple arrays see [`crate::interleave`]
 ///
+/// Note that the semantics of this kernel ("take" elements) is reflected on the output
+/// values. The corresponding elements in the output array are the elements in the input
+/// array at the indices specified in the indices array. This kernel, similar to other
+/// kernels in this crate, does not guarantee the physical memory layout of the output.

Review Comment:
   I think this phrasing might be a bit confusing as the physical memory layout (i.e. arrow arrays) is still guaranteed.
   
   What isn't guaranteed is whether a fresh copy is created or buffers are reused from existing array(s).



-- 
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] doc: Clarify take kernel semantics [arrow-rs]

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on code in PR #6632:
URL: https://github.com/apache/arrow-rs/pull/6632#discussion_r1819661352


##########
arrow-select/src/take.rs:
##########
@@ -50,6 +50,12 @@ use num::{One, Zero};
 ///
 /// For selecting values by index from multiple arrays see [`crate::interleave`]
 ///
+/// Note that the semantics of this kernel ("take" elements) is reflected on the output
+/// values. The corresponding elements in the output array are the elements in the input
+/// array at the indices specified in the indices array. This kernel, similar to other
+/// kernels in this crate, does not guarantee that it creates new buffers or takes/reuses
+/// existing buffers from the input arrays.

Review Comment:
   ```suggestion
   /// Note that this kernel, similar to other kernels in this crate,
   /// will avoid allocating where not necessary. Consequently
   /// the returned array may share buffers with the inputs
   ```
   
   Perhaps?
   
   I at least found the section about semantics being reflected on output values somewhat hard to interpret



-- 
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] doc: Clarify take kernel semantics [arrow-rs]

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


##########
arrow-select/src/take.rs:
##########
@@ -50,6 +50,12 @@ use num::{One, Zero};
 ///
 /// For selecting values by index from multiple arrays see [`crate::interleave`]
 ///
+/// Note that the semantics of this kernel ("take" elements) is reflected on the output
+/// values. The corresponding elements in the output array are the elements in the input
+/// array at the indices specified in the indices array. This kernel, similar to other
+/// kernels in this crate, does not guarantee the physical memory layout of the output.

Review Comment:
   Okay



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