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 2022/03/11 08:48:13 UTC
[GitHub] [arrow-rs] HaoYang670 opened a new pull request #1426: Add doc example for creating `FixedSizeListArray`
HaoYang670 opened a new pull request #1426:
URL: https://github.com/apache/arrow-rs/pull/1426
Signed-off-by: remzi <13...@gmail.com>
# Which issue does this PR close?
Closes #1392.
--
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] sunchao commented on pull request #1426: Add doc example for creating `FixedSizeListArray`
Posted by GitBox <gi...@apache.org>.
sunchao commented on pull request #1426:
URL: https://github.com/apache/arrow-rs/pull/1426#issuecomment-1065929862
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
[GitHub] [arrow-rs] codecov-commenter commented on pull request #1426: Add doc example for creating `FixedSizeListArray`
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #1426:
URL: https://github.com/apache/arrow-rs/pull/1426#issuecomment-1065786959
# [Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1426?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1426](https://codecov.io/gh/apache/arrow-rs/pull/1426?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6cc1876) into [master](https://codecov.io/gh/apache/arrow-rs/commit/4bcc7a678914e9271789797b833a8f731f8b224b?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4bcc7a6) will **decrease** coverage by `0.49%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/arrow-rs/pull/1426/graphs/tree.svg?width=650&height=150&src=pr&token=pq9V9qWZ1N&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/arrow-rs/pull/1426?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1426 +/- ##
==========================================
- Coverage 83.17% 82.68% -0.50%
==========================================
Files 182 185 +3
Lines 53439 53822 +383
==========================================
+ Hits 44449 44502 +53
- Misses 8990 9320 +330
```
| [Impacted Files](https://codecov.io/gh/apache/arrow-rs/pull/1426?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [arrow/src/array/array\_list.rs](https://codecov.io/gh/apache/arrow-rs/pull/1426/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2FycmF5L2FycmF5X2xpc3QucnM=) | `95.52% <ø> (ø)` | |
| [arrow/src/array/array\_binary.rs](https://codecov.io/gh/apache/arrow-rs/pull/1426/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2FycmF5L2FycmF5X2JpbmFyeS5ycw==) | `92.62% <0.00%> (-0.67%)` | :arrow_down: |
| [arrow/src/datatypes/datatype.rs](https://codecov.io/gh/apache/arrow-rs/pull/1426/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2RhdGF0eXBlcy9kYXRhdHlwZS5ycw==) | `66.40% <0.00%> (-0.40%)` | :arrow_down: |
| [arrow/src/array/transform/mod.rs](https://codecov.io/gh/apache/arrow-rs/pull/1426/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2FycmF5L3RyYW5zZm9ybS9tb2QucnM=) | `86.31% <0.00%> (-0.12%)` | :arrow_down: |
| [arrow/src/compute/kernels/substring.rs](https://codecov.io/gh/apache/arrow-rs/pull/1426/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2NvbXB1dGUva2VybmVscy9zdWJzdHJpbmcucnM=) | `98.24% <0.00%> (-0.04%)` | :arrow_down: |
| [arrow-flight/src/lib.rs](https://codecov.io/gh/apache/arrow-rs/pull/1426/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3ctZmxpZ2h0L3NyYy9saWIucnM=) | `18.54% <0.00%> (ø)` | |
| [arrow/src/compute/kernels/window.rs](https://codecov.io/gh/apache/arrow-rs/pull/1426/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2NvbXB1dGUva2VybmVscy93aW5kb3cucnM=) | `100.00% <0.00%> (ø)` | |
| [arrow-flight/src/sql/mod.rs](https://codecov.io/gh/apache/arrow-rs/pull/1426/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3ctZmxpZ2h0L3NyYy9zcWwvbW9kLnJz) | `0.00% <0.00%> (ø)` | |
| [arrow-flight/examples/flight\_sql\_server.rs](https://codecov.io/gh/apache/arrow-rs/pull/1426/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3ctZmxpZ2h0L2V4YW1wbGVzL2ZsaWdodF9zcWxfc2VydmVyLnJz) | `0.00% <0.00%> (ø)` | |
| [arrow-flight/src/sql/server.rs](https://codecov.io/gh/apache/arrow-rs/pull/1426/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3ctZmxpZ2h0L3NyYy9zcWwvc2VydmVyLnJz) | `0.00% <0.00%> (ø)` | |
| ... and [6 more](https://codecov.io/gh/apache/arrow-rs/pull/1426/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1426?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1426?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4bcc7a6...6cc1876](https://codecov.io/gh/apache/arrow-rs/pull/1426?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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] HaoYang670 commented on a change in pull request #1426: Add doc example for creating `FixedSizeListArray`
Posted by GitBox <gi...@apache.org>.
HaoYang670 commented on a change in pull request #1426:
URL: https://github.com/apache/arrow-rs/pull/1426#discussion_r825225241
##########
File path: arrow/src/array/array_list.rs
##########
@@ -342,6 +342,46 @@ pub type LargeListArray = GenericListArray<i64>;
/// A list array where each element is a fixed-size sequence of values with the same
/// type whose maximum length is represented by a i32.
+/// # Example
+///
+/// ```
+/// # use arrow::array::{Array, ArrayData, FixedSizeListArray, Int32Array};
+/// # use arrow::datatypes::{DataType, Field};
+/// # use arrow::buffer::Buffer;
+/// // Construct a value array
+/// let value_data = ArrayData::builder(DataType::Int32)
+/// .len(9)
+/// .add_buffer(Buffer::from_slice_ref(&[0, 1, 2, 3, 4, 5, 6, 7, 8]))
+/// .build()
+/// .unwrap();
+//// // Construct a list array from the above two
Review comment:
delete the comment.
Actually, I copied the comment from https://github.com/apache/arrow-rs/blob/master/arrow/src/array/array_list.rs#L692
--
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] sunchao merged pull request #1426: Add doc example for creating `FixedSizeListArray`
Posted by GitBox <gi...@apache.org>.
sunchao merged pull request #1426:
URL: https://github.com/apache/arrow-rs/pull/1426
--
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] sunchao commented on a change in pull request #1426: Add doc example for creating `FixedSizeListArray`
Posted by GitBox <gi...@apache.org>.
sunchao commented on a change in pull request #1426:
URL: https://github.com/apache/arrow-rs/pull/1426#discussion_r824882822
##########
File path: arrow/src/array/array_list.rs
##########
@@ -342,6 +342,46 @@ pub type LargeListArray = GenericListArray<i64>;
/// A list array where each element is a fixed-size sequence of values with the same
/// type whose maximum length is represented by a i32.
+/// # Example
+///
+/// ```
+/// # use arrow::array::{Array, ArrayData, FixedSizeListArray, Int32Array};
+/// # use arrow::datatypes::{DataType, Field};
+/// # use arrow::buffer::Buffer;
+/// // Construct a value array
+/// let value_data = ArrayData::builder(DataType::Int32)
+/// .len(9)
+/// .add_buffer(Buffer::from_slice_ref(&[0, 1, 2, 3, 4, 5, 6, 7, 8]))
+/// .build()
+/// .unwrap();
+//// // Construct a list array from the above two
Review comment:
"from above two"?
##########
File path: arrow/src/array/array_list.rs
##########
@@ -342,6 +342,46 @@ pub type LargeListArray = GenericListArray<i64>;
/// A list array where each element is a fixed-size sequence of values with the same
/// type whose maximum length is represented by a i32.
+/// # Example
Review comment:
nit: can we add a blank line before?
##########
File path: arrow/src/array/array_list.rs
##########
@@ -342,6 +342,46 @@ pub type LargeListArray = GenericListArray<i64>;
/// A list array where each element is a fixed-size sequence of values with the same
/// type whose maximum length is represented by a i32.
+/// # Example
+///
+/// ```
+/// # use arrow::array::{Array, ArrayData, FixedSizeListArray, Int32Array};
+/// # use arrow::datatypes::{DataType, Field};
+/// # use arrow::buffer::Buffer;
+/// // Construct a value array
+/// let value_data = ArrayData::builder(DataType::Int32)
+/// .len(9)
+/// .add_buffer(Buffer::from_slice_ref(&[0, 1, 2, 3, 4, 5, 6, 7, 8]))
+/// .build()
+/// .unwrap();
+//// // Construct a list array from the above two
+/// let list_data_type = DataType::FixedSizeList(
+/// Box::new(Field::new("item", DataType::Int32, false)),
+/// 3,
+/// );
+/// let list_data = ArrayData::builder(list_data_type.clone())
+/// .len(3)
+/// .add_child_data(value_data.clone())
+/// .build()
+/// .unwrap();
+/// let list_array = FixedSizeListArray::from(list_data);
+/// let values = list_array.values();
+/// assert_eq!(&value_data, values.data());
+/// assert_eq!(DataType::Int32, list_array.value_type());
+/// assert_eq!(3, list_array.len());
+/// assert_eq!(0, list_array.null_count());
+/// assert_eq!(6, list_array.value_offset(2));
+/// assert_eq!(3, list_array.value_length());
+/// assert_eq!(
Review comment:
maybe it's clearer to compare whole array content here, for instance, checking `list_array.value(1)` is `[0, 1, 2]`, `list_array.value(2)` is `[3, 4, 5]`, etc.
--
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] HaoYang670 commented on a change in pull request #1426: Add doc example for creating `FixedSizeListArray`
Posted by GitBox <gi...@apache.org>.
HaoYang670 commented on a change in pull request #1426:
URL: https://github.com/apache/arrow-rs/pull/1426#discussion_r825225325
##########
File path: arrow/src/array/array_list.rs
##########
@@ -342,6 +342,46 @@ pub type LargeListArray = GenericListArray<i64>;
/// A list array where each element is a fixed-size sequence of values with the same
/// type whose maximum length is represented by a i32.
+/// # Example
+///
+/// ```
+/// # use arrow::array::{Array, ArrayData, FixedSizeListArray, Int32Array};
+/// # use arrow::datatypes::{DataType, Field};
+/// # use arrow::buffer::Buffer;
+/// // Construct a value array
+/// let value_data = ArrayData::builder(DataType::Int32)
+/// .len(9)
+/// .add_buffer(Buffer::from_slice_ref(&[0, 1, 2, 3, 4, 5, 6, 7, 8]))
+/// .build()
+/// .unwrap();
+//// // Construct a list array from the above two
+/// let list_data_type = DataType::FixedSizeList(
+/// Box::new(Field::new("item", DataType::Int32, false)),
+/// 3,
+/// );
+/// let list_data = ArrayData::builder(list_data_type.clone())
+/// .len(3)
+/// .add_child_data(value_data.clone())
+/// .build()
+/// .unwrap();
+/// let list_array = FixedSizeListArray::from(list_data);
+/// let values = list_array.values();
+/// assert_eq!(&value_data, values.data());
+/// assert_eq!(DataType::Int32, list_array.value_type());
+/// assert_eq!(3, list_array.len());
+/// assert_eq!(0, list_array.null_count());
+/// assert_eq!(6, list_array.value_offset(2));
+/// assert_eq!(3, list_array.value_length());
+/// assert_eq!(
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
[GitHub] [arrow-rs] HaoYang670 commented on a change in pull request #1426: Add doc example for creating `FixedSizeListArray`
Posted by GitBox <gi...@apache.org>.
HaoYang670 commented on a change in pull request #1426:
URL: https://github.com/apache/arrow-rs/pull/1426#discussion_r825225080
##########
File path: arrow/src/array/array_list.rs
##########
@@ -342,6 +342,46 @@ pub type LargeListArray = GenericListArray<i64>;
/// A list array where each element is a fixed-size sequence of values with the same
/// type whose maximum length is represented by a i32.
+/// # Example
+///
+/// ```
+/// # use arrow::array::{Array, ArrayData, FixedSizeListArray, Int32Array};
+/// # use arrow::datatypes::{DataType, Field};
+/// # use arrow::buffer::Buffer;
+/// // Construct a value array
+/// let value_data = ArrayData::builder(DataType::Int32)
+/// .len(9)
+/// .add_buffer(Buffer::from_slice_ref(&[0, 1, 2, 3, 4, 5, 6, 7, 8]))
+/// .build()
+/// .unwrap();
+//// // Construct a list array from the above two
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
[GitHub] [arrow-rs] HaoYang670 commented on a change in pull request #1426: Add doc example for creating `FixedSizeListArray`
Posted by GitBox <gi...@apache.org>.
HaoYang670 commented on a change in pull request #1426:
URL: https://github.com/apache/arrow-rs/pull/1426#discussion_r825225880
##########
File path: arrow/src/array/array_list.rs
##########
@@ -342,6 +342,46 @@ pub type LargeListArray = GenericListArray<i64>;
/// A list array where each element is a fixed-size sequence of values with the same
/// type whose maximum length is represented by a i32.
+/// # Example
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
[GitHub] [arrow-rs] jackwener commented on a change in pull request #1426: Add doc example for creating `FixedSizeListArray`
Posted by GitBox <gi...@apache.org>.
jackwener commented on a change in pull request #1426:
URL: https://github.com/apache/arrow-rs/pull/1426#discussion_r824560482
##########
File path: arrow/src/array/array_list.rs
##########
@@ -342,6 +342,46 @@ pub type LargeListArray = GenericListArray<i64>;
/// A list array where each element is a fixed-size sequence of values with the same
/// type whose maximum length is represented by a i32.
+/// # Example
+///
+/// ```
+/// # use arrow::array::{Array, ArrayData, FixedSizeListArray, Int32Array};
+/// # use arrow::datatypes::{DataType, Field};
+/// # use arrow::buffer::Buffer;
+/// // Construct a value array
+/// let value_data = ArrayData::builder(DataType::Int32)
+/// .len(9)
+/// .add_buffer(Buffer::from_slice_ref(&[0, 1, 2, 3, 4, 5, 6, 7, 8]))
+/// .build()
+/// .unwrap();
+//// // Construct a list array from the above two
Review comment:
Extra space
--
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] jackwener commented on pull request #1426: Add doc example for creating `FixedSizeListArray`
Posted by GitBox <gi...@apache.org>.
jackwener commented on pull request #1426:
URL: https://github.com/apache/arrow-rs/pull/1426#issuecomment-1064963693
BTW, I found that some examples include many assert_check. Just there is a question for me, is it necessary to include many checks in the example?
--
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