You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Weijun-H (via GitHub)" <gi...@apache.org> on 2023/11/23 14:39:39 UTC
[PR] feat: support cast between nested list and largelist [arrow-rs]
Weijun-H opened a new pull request, #5121:
URL: https://github.com/apache/arrow-rs/pull/5121
# 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 #5113
# 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] feat: support cast between nested list and largelist [arrow-rs]
Posted by "Weijun-H (via GitHub)" <gi...@apache.org>.
Weijun-H commented on PR #5121:
URL: https://github.com/apache/arrow-rs/pull/5121#issuecomment-1827386762
Closed in favor of #5124
--
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] feat: support cast between nested list and largelist [arrow-rs]
Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on code in PR #5121:
URL: https://github.com/apache/arrow-rs/pull/5121#discussion_r1405475808
##########
arrow-cast/src/cast.rs:
##########
@@ -7459,6 +7471,48 @@ mod tests {
assert_eq!(&expected.value(2), &actual.value(2));
}
+ #[test]
+ fn test_cast_nested_list_container() {
+ // large-list to list
+ let array = Arc::new(make_large_list_array()) as ArrayRef;
+ let list_array = cast(
+ &array,
+ &DataType::List(Arc::new(Field::new(
+ "",
+ DataType::List(Arc::new(Field::new("", DataType::Int32, false))),
+ false,
+ ))),
+ )
+ .unwrap();
+ let actual = list_array.as_any().downcast_ref::<ListArray>().unwrap();
Review Comment:
Can we please use AsArray in tests, i.e. `.as_list::<i32>()` it is much easier to read
##########
arrow-cast/src/cast.rs:
##########
@@ -7459,6 +7471,48 @@ mod tests {
assert_eq!(&expected.value(2), &actual.value(2));
}
+ #[test]
+ fn test_cast_nested_list_container() {
+ // large-list to list
+ let array = Arc::new(make_large_list_array()) as ArrayRef;
+ let list_array = cast(
+ &array,
+ &DataType::List(Arc::new(Field::new(
+ "",
+ DataType::List(Arc::new(Field::new("", DataType::Int32, false))),
Review Comment:
AFAICT this test simply ignores the nested list here, and is returning a non-nested list. This is consistent with my reading of cast_list_container
--
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] feat: support cast between nested list and largelist [arrow-rs]
Posted by "Weijun-H (via GitHub)" <gi...@apache.org>.
Weijun-H closed pull request #5121: feat: support cast between nested list and largelist
URL: https://github.com/apache/arrow-rs/pull/5121
--
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] feat: support cast between nested list and largelist [arrow-rs]
Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on PR #5121:
URL: https://github.com/apache/arrow-rs/pull/5121#issuecomment-1826900148
Reviewing cast_list_container the issue and why this check is present, is that it currently doesn't recurse and cast the value data.
It took me a while to notice this, and I ended up getting quite nerd-sniped by this, so ended up just cleaning this logic up in https://github.com/apache/arrow-rs/pull/5124 PTAL
--
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