dtenedor opened a new pull request, #47834:
URL: https://github.com/apache/spark/pull/47834
### What changes were proposed in this pull request?
This PR make the `TO_AVRO` SQL function `jsonFormatSchema` argument optional.
For example, now it is possible to just call it with a single input argument:
```
create table t as
select named_struct('u', named_struct('member0', member0, 'member1',
member1)) as s
from values (1, null), (null, 'a') tab(member0, member1);
select length(to_avro(s)) > 0 from t;
> true
true
```
### Why are the changes needed?
This makes the `TO_AVRO` SQL function easier to use.
### Does this PR introduce _any_ user-facing change?
Yes, see above.
### How was this patch tested?
This PR adds unit test coverge.
### Was this patch authored or co-authored using generative AI tooling?
No.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]