Commit 9986462
[SPARK-47385] Fix tuple encoders with Option inputs
## What changes were proposed in this pull request?
#40755 adds a null check on the input of the child deserializer in the tuple encoder. It breaks the deserializer for the `Option` type, because null should be deserialized into `None` rather than null. This PR adds a boolean parameter to `ExpressionEncoder.tuple` so that only the user that #40755 intended to fix has this null check.
## How was this patch tested?
Unit test.
Closes #45508 from chenhao-db/SPARK-47385.
Authored-by: Chenhao Li <chenhao.li@databricks.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>1 parent e980211 commit 9986462
File tree
3 files changed
+23
-3
lines changed- sql
- catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders
- core/src
- main/scala/org/apache/spark/sql
- test/scala/org/apache/spark/sql
3 files changed
+23
-3
lines changedLines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
76 | 80 | | |
77 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
78 | 84 | | |
79 | 85 | | |
80 | 86 | | |
| |||
119 | 125 | | |
120 | 126 | | |
121 | 127 | | |
122 | | - | |
| 128 | + | |
123 | 129 | | |
124 | 130 | | |
125 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1246 | 1246 | | |
1247 | 1247 | | |
1248 | 1248 | | |
1249 | | - | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
1250 | 1252 | | |
1251 | 1253 | | |
1252 | 1254 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2576 | 2576 | | |
2577 | 2577 | | |
2578 | 2578 | | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
2579 | 2591 | | |
2580 | 2592 | | |
2581 | 2593 | | |
| |||
0 commit comments