Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-49863][SQL] Fix NormalizeFloatingNumbers to preserve nullabili…
…ty of nested structs ### What changes were proposed in this pull request? - Fixes a bug in `NormalizeFloatingNumbers` to respect the `nullable` attribute of nested expressions when normalizing. ### Why are the changes needed? - Without the fix, there would be a degradation in the nullability of the expression post normalization. - For example, for an expression like: `namedStruct("struct", namedStruct("double", <DoubleType-field>)) ` with the following data type: ``` StructType(StructField("struct", StructType(StructField("double", DoubleType, true, {})), false, {})) ``` after normalizing we would have ended up with the dataType: ``` StructType(StructField("struct", StructType(StructField("double", DoubleType, true, {})), true, {})) ``` Note, the change in the `nullable` attribute of the "double" StructField from `false` to `true`. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? - Added unit test. ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#48331 from nikhilsheoran-db/SPARK-49863-fix. Authored-by: Nikhil Sheoran <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
- Loading branch information