You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "crepererum (via GitHub)" <gi...@apache.org> on 2023/04/21 10:04:29 UTC
[GitHub] [arrow-datafusion] crepererum opened a new pull request, #6085: fix: null handling of `ScalarValue::Struct`
crepererum opened a new pull request, #6085:
URL: https://github.com/apache/arrow-datafusion/pull/6085
# Which issue does this PR close?
Fixes #6083.
# Rationale for this change
I should be possible to create a truly NULL struct, not only a struct w/ all-NULL members.
# What changes are included in this PR?
Fix NULL handling for `ScalarValue::Struct(None, ...)`.
# Are these changes tested?
1. existing tests pass
2. new test that checks `ScalarValue::to_array` and `ScalarValue::iter_to_array`
# Are there any user-facing changes?
`ScalarValue::Struct(None, ...)` now produces true NULL values that also pass the arrow `is_null` kernel.
--
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-datafusion] alamb commented on a diff in pull request #6085: fix: null handling of `ScalarValue::Struct`
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #6085:
URL: https://github.com/apache/arrow-datafusion/pull/6085#discussion_r1174406402
##########
datafusion/common/src/scalar.rs:
##########
@@ -5584,6 +5584,87 @@ mod tests {
}
}
+ #[test]
Review Comment:
I ran the same commands on this branch:
```
❯ select struct(1, 2);
+---------------------------+
| struct(Int64(1),Int64(2)) |
+---------------------------+
| {c0: 1, c1: 2} |
+---------------------------+
1 row in set. Query took 0.002 seconds.
❯ select struct(null, 2);
+-----------------------+
| struct(NULL,Int64(2)) |
+-----------------------+
| {c0: , c1: 2} |
+-----------------------+
1 row in set. Query took 0.002 seconds.
❯ select null::struct;
This feature is not implemented: Unsupported SQL type Custom(ObjectName([Ident { value: "struct", quote_style: None }]), [])
```
And the results seem the same
--
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-datafusion] alamb merged pull request #6085: fix: null handling of `ScalarValue::Struct`
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #6085:
URL: https://github.com/apache/arrow-datafusion/pull/6085
--
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-datafusion] comphead commented on a diff in pull request #6085: fix: null handling of `ScalarValue::Struct`
Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on code in PR #6085:
URL: https://github.com/apache/arrow-datafusion/pull/6085#discussion_r1173926250
##########
datafusion/common/src/scalar.rs:
##########
@@ -5584,6 +5584,87 @@ mod tests {
}
}
+ #[test]
Review Comment:
That looks good, I checked current impl
```
select struct(1, 2);
+---------------------------+
| struct(Int64(1),Int64(2)) |
+---------------------------+
| {c0: 1, c1: 2} |
+---------------------------+
1 row in set. Query took 0.002 seconds.
❯ select struct(null, 2);
+-----------------------+
| struct(NULL,Int64(2)) |
+-----------------------+
| {c0: , c1: 2} |
+-----------------------+
1 row in set. Query took 0.003 seconds.
❯ select null::struct;
This feature is not implemented: Unsupported SQL type Custom(ObjectName([Ident { value: "struct", quote_style: None }]), [])
```
@crepererum will this fix also address the exception above?
--
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