Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-49342][SQL] Make TO_AVRO SQL function 'jsonFormatSchema' argum…
…ent optional ### 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. Closes apache#47834 from dtenedor/to-avro-schema-optional. Authored-by: Daniel Tenedorio <[email protected]> Signed-off-by: Max Gekk <[email protected]>
- Loading branch information