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/11/27 11:50:52 UTC

[GitHub] [arrow-rs] Jefffrey opened a new pull request, #3205: Ensure StructArrays check nullability of fields

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

   # 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 #1167
   
   # 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.
   -->
   
   Main fix: when building using `StructArray::from`, check that if child fields are set as non-nullable, then their values respect this; if they don't then will panic
   
   Other fixes to `StructArray::from`:
   
   - Fix issue  where if pass empty vector then it panics (since used to index `[0]` to get length to compare)
   - Fix issue where not checking datatype of field against values if vector is of size 1
   
   # 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 merged pull request #3205: Ensure StructArrays check nullability of fields

Posted by GitBox <gi...@apache.org>.
tustvold merged PR #3205:
URL: https://github.com/apache/arrow-rs/pull/3205


-- 
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] ursabot commented on pull request #3205: Ensure StructArrays check nullability of fields

Posted by GitBox <gi...@apache.org>.
ursabot commented on PR #3205:
URL: https://github.com/apache/arrow-rs/pull/3205#issuecomment-1330417373

   Benchmark runs are scheduled for baseline = 4926bad4d1ae653d01923ebf16d71055eb76da6d and contender = 1d6b5ab71eec290ffd9656e15bb06aed2b820148. 1d6b5ab71eec290ffd9656e15bb06aed2b820148 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/4b8af5227f7441d49b501f2fc6cbc60e...c18ba8c807a345a9b4cd807d09d15772/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/64210e9360ce4dce96082219d6c8d00f...0421fe0e0e2249de8bb8fdfe94231c72/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/4ab5b6afc4d54390a2d7cdf24608667a...77340b98ec364c298e0d52dde2197ac0/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/e03db81db9044b049f0819ad4b68c5d4...45d7c71f7c6543d29c5260af2fcb33bb/)
   Buildkite builds:
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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] Jefffrey commented on pull request #3205: Ensure StructArrays check nullability of fields

Posted by GitBox <gi...@apache.org>.
Jefffrey commented on PR #3205:
URL: https://github.com/apache/arrow-rs/pull/3205#issuecomment-1328229723

   I was under the impression that child fields of a StructArray must have their values respect their nullability, however given how many tests I needed to fix I'm a bit more uncertain on this now... Would appreciate some clarification on expected behaviour.


-- 
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 #3205: Ensure StructArrays check nullability of fields

Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #3205:
URL: https://github.com/apache/arrow-rs/pull/3205#discussion_r1033768581


##########
arrow-array/src/array/mod.rs:
##########
@@ -916,7 +916,7 @@ mod tests {
     #[test]
     fn test_null_struct() {
         let struct_type =
-            DataType::Struct(vec![Field::new("data", DataType::Int64, false)]);
+            DataType::Struct(vec![Field::new("data", DataType::Int64, true)]);

Review Comment:
   This actually highlights a somewhat fun issue that I'm also running into with the row format (#3159), namely how to create a null `StructArray` with children that aren't nullable. I _think_ new_null_array should discard the null mask for its children, but I'm not 100% sure. I need to think a bit more on this



-- 
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 #3205: Ensure StructArrays check nullability of fields

Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #3205:
URL: https://github.com/apache/arrow-rs/pull/3205#discussion_r1033776747


##########
arrow-array/src/builder/map_builder.rs:
##########
@@ -286,8 +286,8 @@ mod tests {
 
         let string_builder = builder.keys();
         string_builder.append_value("joe");
-        string_builder.append_null();
-        string_builder.append_null();
+        string_builder.append_value("n1");

Review Comment:
   We should probably add an error to MapArrayBuilder so that it returns a meaningful error if you try to create a keys array with nulls. I believe this may overlap somewhat with https://github.com/apache/arrow-rs/issues/1697



-- 
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] Jefffrey commented on a diff in pull request #3205: Ensure StructArrays check nullability of fields

Posted by GitBox <gi...@apache.org>.
Jefffrey commented on code in PR #3205:
URL: https://github.com/apache/arrow-rs/pull/3205#discussion_r1034549958


##########
arrow-array/src/builder/map_builder.rs:
##########
@@ -286,8 +286,8 @@ mod tests {
 
         let string_builder = builder.keys();
         string_builder.append_value("joe");
-        string_builder.append_null();
-        string_builder.append_null();
+        string_builder.append_value("n1");

Review Comment:
   I can give this a shot, but probably won't get much progress until the weekend, so can open a separate PR if needed



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