Commit 53d20b2
committed
fix: support to_json on Spark 4.0
In Spark 4.0, StructsToJson is a RuntimeReplaceable whose replacement is
Invoke(Literal(StructsToJsonEvaluator), "evaluate", ...). Comet's serde
saw the post-replacement Invoke and fell back with "invoke is not
supported". Add a Spark 4-only matcher in CometExprShim that detects this
specific Invoke shape, reconstructs StructsToJson from the evaluator's
options, child, and timeZoneId, and recurses through exprToProtoInternal
so support-level checks still apply. Re-enable the four to_json tests
that were skipped on Spark 4.
Closes #39201 parent 29bcb75 commit 53d20b2
3 files changed
Lines changed: 15 additions & 9 deletions
File tree
- spark/src
- main/spark-4.0/org/apache/comet/shims
- test/scala/org/apache/comet
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
117 | 131 | | |
118 | 132 | | |
119 | 133 | | |
| |||
Lines changed: 0 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2271 | 2271 | | |
2272 | 2272 | | |
2273 | 2273 | | |
2274 | | - | |
2275 | | - | |
2276 | 2274 | | |
2277 | 2275 | | |
2278 | 2276 | | |
| |||
2298 | 2296 | | |
2299 | 2297 | | |
2300 | 2298 | | |
2301 | | - | |
2302 | | - | |
2303 | 2299 | | |
2304 | 2300 | | |
2305 | 2301 | | |
| |||
2329 | 2325 | | |
2330 | 2326 | | |
2331 | 2327 | | |
2332 | | - | |
2333 | | - | |
2334 | 2328 | | |
2335 | 2329 | | |
2336 | 2330 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| |||
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
51 | | - | |
52 | 50 | | |
53 | 51 | | |
54 | 52 | | |
| |||
0 commit comments