crepererum opened a new issue, #6074:
URL: https://github.com/apache/arrow-datafusion/issues/6074
### Is your feature request related to a problem or challenge?
`coalsece` currently does not support structs. If it would however, I think
it should only consider top-level NULLs, so `coalsece(NULL, {a: 1, b: NULL},
{a: 2, b: 3}) = {a: 1, b: NULL}`. However sometimes it would be handy to fill
in fields recursively. So `coalsece_nested(NULL, {a: 1, b: NULL}, {a: 2, b: 3})
= {a: 1, b: 3}`
### Describe the solution you'd like
Have a `coalesce` variant that supports structs by traversing them
recursively. So:
```sql
coalesce_nested(
NULL,
{
a: 1,
b: NULL,
c: NULL,
d: NULL,
},
{
a: 2,
b: NULL,
c: {a: NULL},
d: {a: 2, b: NULL},
},
{
a: 3,
b: NULL,
c: NULL,
d: {a: 3, b: 3},
},
)
=
{
a: 1,
b: NULL,
c: {a: NULL},
d: {a: 2, b: 3},
}
```
### Describe alternatives you've considered
\-
### Additional context
A user that fully knows the type could manually construct this using
`coalesce` and `named_struct` (proposed in #5861).
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]