Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Swift] Decoding of nullable types value when nil is found #42041

Closed
abandy opened this issue Jun 9, 2024 · 1 comment
Closed

[Swift] Decoding of nullable types value when nil is found #42041

abandy opened this issue Jun 9, 2024 · 1 comment

Comments

@abandy
Copy link
Contributor

abandy commented Jun 9, 2024

Describe the bug, including details regarding any error messages, version, and platform.

When a nullable type is being decoded (String?, Int8?, Int32?...) the doDecode check will always return nil as nullable type is not convertible to a non null type (Int8? != Int8).

Adding IsNull methods to the decoder class to resolve this issue.

Component(s)

Swift

abandy added a commit to abandy/arrow that referenced this issue Jun 9, 2024
abandy added a commit to abandy/arrow that referenced this issue Jun 9, 2024
abandy added a commit to abandy/arrow that referenced this issue Jun 9, 2024
kou pushed a commit that referenced this issue Jun 9, 2024
### Rationale for this change

There is an issue when decoding nullable types.  The previous method of checking for nil values always returned false for nullable types due too the ArrowArray types being non nullable.

### What changes are included in this PR?
This PR adds a IsNull method to the ArrowDecoder to be used for null checks.  Also, a check for nullable types has been added to the Unkeyed decode method.

### Are these changes tested?
Yes, tests have been added/modified to test this fix.
* GitHub Issue: #42041

Authored-by: Alva Bandy <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
@kou kou added this to the 17.0.0 milestone Jun 9, 2024
@kou
Copy link
Member

kou commented Jun 9, 2024

Issue resolved by pull request 42043
#42043

@kou kou closed this as completed Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants