You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tustvold (via GitHub)" <gi...@apache.org> on 2023/04/04 18:39:01 UTC

[GitHub] [arrow-rs] tustvold opened a new pull request, #4019: Deprecate Array::data (#3880)

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

   # 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.
   -->
   
   Part of #3880
   
   # 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


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #4019: Deprecate Array::data (#3880)

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


##########
arrow-cast/src/cast.rs:
##########
@@ -4875,15 +4874,9 @@ mod tests {
         assert_eq!(0, cast_array.null_count());
 
         // offsets should be the same
-        assert_eq!(

Review Comment:
   List arrays only contain a single buffer, and so `assert_eq!(list_array.value_offsets(), array.value_offsets());` is equivalent



-- 
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] askoa commented on a diff in pull request #4019: Deprecate Array::data (#3880)

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


##########
arrow-array/src/array/mod.rs:
##########
@@ -111,6 +110,7 @@ pub trait Array: std::fmt::Debug + Send + Sync {
     ///
     /// This will be deprecated in a future release [(#3880)](https://github.com/apache/arrow-rs/issues/3880)

Review Comment:
   ```suggestion
       /// This will be removed in a future release [(#3880)](https://github.com/apache/arrow-rs/issues/3880)
   ```



-- 
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 #4019: Deprecate Array::data (#3880)

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


##########
arrow-array/src/array/mod.rs:
##########
@@ -111,6 +110,7 @@ pub trait Array: std::fmt::Debug + Send + Sync {
     ///
     /// This will be deprecated in a future release [(#3880)](https://github.com/apache/arrow-rs/issues/3880)
     #[deprecated(note = "Use Array::to_data or Array::into_data")]
+    #[allow(deprecated)]

Review Comment:
   Part of #3880 will be to port these to not use `Array::data`



-- 
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] alamb commented on a diff in pull request #4019: Deprecate Array::data (#3880)

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


##########
arrow-select/src/concat.rs:
##########
@@ -81,7 +81,8 @@ pub fn concat(arrays: &[&dyn Array]) -> Result<ArrayRef, ArrowError> {
         _ => Capacities::Array(arrays.iter().map(|a| a.len()).sum()),
     };
 
-    let array_data = arrays.iter().map(|a| a.data()).collect::<Vec<_>>();
+    let array_data: Vec<_> = arrays.iter().map(|a| a.to_data()).collect::<Vec<_>>();
+    let array_data = array_data.iter().collect();

Review Comment:
   why do we need the second iter/collect? 
   
   Update: Because it wants a Vec of `&ArrayData`



##########
arrow-cast/src/cast.rs:
##########
@@ -4875,15 +4874,9 @@ mod tests {
         assert_eq!(0, cast_array.null_count());
 
         // offsets should be the same
-        assert_eq!(

Review Comment:
   Is the equality comparison still covered?



##########
arrow-select/src/interleave.rs:
##########
@@ -193,7 +193,8 @@ fn interleave_fallback(
     values: &[&dyn Array],
     indices: &[(usize, usize)],
 ) -> Result<ArrayRef, ArrowError> {
-    let arrays: Vec<_> = values.iter().map(|x| x.data()).collect();
+    let arrays: Vec<_> = values.iter().map(|x| x.to_data()).collect();
+    let arrays: Vec<_> = arrays.iter().collect();

Review Comment:
   We could potentially change the `MutableArrayData` constructor to take `impl IntoIterator<Item = &'ArrayData>` but that seems like it just moves the copy around.



##########
arrow-array/src/array/binary_array.rs:
##########
@@ -467,9 +467,6 @@ mod tests {
         let list_array = GenericListArray::<O>::from(array_data2);
         let binary_array2 = GenericBinaryArray::<O>::from(list_array);
 
-        assert_eq!(2, binary_array2.data().buffers().len());

Review Comment:
   This test is no longer needed because the ArrayData builder will check the buffer count (is that correct)?



-- 
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 #4019: Deprecate Array::data (#3880)

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


##########
arrow-select/src/interleave.rs:
##########
@@ -193,7 +193,8 @@ fn interleave_fallback(
     values: &[&dyn Array],
     indices: &[(usize, usize)],
 ) -> Result<ArrayRef, ArrowError> {
-    let arrays: Vec<_> = values.iter().map(|x| x.data()).collect();
+    let arrays: Vec<_> = values.iter().map(|x| x.to_data()).collect();
+    let arrays: Vec<_> = arrays.iter().collect();

Review Comment:
   This is perhaps a little unfortunate, but given what this operation is doing, it is not going to be relevant to the benchmarks, the machinery of creating a MutableArrayData alone is likely more costly



-- 
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 #4019: Deprecate Array::data (#3880)

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


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