You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2024/07/27 12:33:10 UTC
[PR] Add additional documentation and examples to `ArrayAccessor` [arrow-rs]
alamb opened a new pull request, #6141:
URL: https://github.com/apache/arrow-rs/pull/6141
# Which issue does this PR close?
N/A
# Rationale for this change
While reviewing https://github.com/apache/datafusion/pull/11676 from @XiangpengHao I wanted to try and increase the liklihood that others can write such generic code.
I thought the example from that code from that PR into an example
# What changes are included in this PR?
Improve doc comments, add example in `ArrayAccessor`
# 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] Add additional documentation and examples to `ArrayAccessor` [arrow-rs]
Posted by "XiangpengHao (via GitHub)" <gi...@apache.org>.
XiangpengHao commented on PR #6141:
URL: https://github.com/apache/arrow-rs/pull/6141#issuecomment-2254161501
Some closely related code: https://github.com/apache/arrow-rs/blob/705d3414eb991c234aaced332c11973e997d360f/arrow-string/src/like.rs#L151-L161
--
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] Add additional documentation and examples to `ArrayAccessor` [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #6141:
URL: https://github.com/apache/arrow-rs/pull/6141
--
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] Add additional documentation and examples to `ArrayAccessor` [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #6141:
URL: https://github.com/apache/arrow-rs/pull/6141#discussion_r1693951515
##########
arrow-array/src/array/mod.rs:
##########
@@ -437,13 +437,84 @@ impl<'a, T: Array> Array for &'a T {
/// A generic trait for accessing the values of an [`Array`]
///
+/// This trait helps write specialized implementations of algorithms for
+/// different array types. Specialized implementations allow the compiler
+/// to optimize the code for the specific array type, which can lead to
+/// significant performance improvements.
+///
+/// # Example
Review Comment:
This example is adapted from https://github.com/apache/datafusion/pull/11676
##########
arrow/src/lib.rs:
##########
@@ -81,10 +86,11 @@
//!
//! # Type Erasure / Trait Objects
//!
-//! It is often the case that code wishes to handle any type of array, without necessarily knowing
-//! its concrete type. This use-case is catered for by a combination of [`Array`]
-//! and [`DataType`](datatypes::DataType), with the former providing a type-erased container for
-//! the array, and the latter identifying the concrete type of array.
+//! It is common to write code that handles any type of array, without necessarily
Review Comment:
I tried to make this less verbose so it was easier to read.
--
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] Add additional documentation and examples to `ArrayAccessor` [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #6141:
URL: https://github.com/apache/arrow-rs/pull/6141#issuecomment-2263480948
Thank you for the review @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