Commit a309a05
[SPARK-54390][SS] Fix JSON Deserialize in StreamingQueryListenerBus
### What changes were proposed in this pull request?
The PR changes a few things:
1. Convert JSON objects and array to strings when deserializing using `ObjectToStringDeserializer`. (main fix)
2. Sets the default values for `inputRowsPerSecond` and `processedRowsPerSecond` to be `Double.NaN`. This fixes another silent deserialization issue. (fix makes testing easier)
3. When getting `jsonValue ` for `"observedMetrics"` in `StreamingQueryProgress` we return `JNothing` if parsing fails. (fix makes testing easier, but is also another issue that needs to be addressed in the future)
### Why are the changes needed?
When using Spark Connect, JSON based offsets will not be deserialized properly.
### Does this PR introduce _any_ user-facing change?
Yes, this corrects the issues with the StreamingQueryListener with Spark Connect.
### How was this patch tested?
Added a new test progress to unit tests which contains Object and Array based source offsets.
### Was this patch authored or co-authored using generative AI tooling?
No
Closes #53102 from dylanwong250/SPARK-54390.
Authored-by: Dylan Wong <[email protected]>
Signed-off-by: Anish Shrigondekar <[email protected]>1 parent 8fe006b commit a309a05
File tree
3 files changed
+302
-14
lines changed- sql
- api/src/main/scala/org/apache/spark/sql/streaming
- core/src/test/scala/org/apache/spark/sql/streaming
3 files changed
+302
-14
lines changedLines changed: 37 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
191 | 192 | | |
192 | 193 | | |
193 | 194 | | |
194 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
195 | 208 | | |
196 | 209 | | |
197 | 210 | | |
| |||
210 | 223 | | |
211 | 224 | | |
212 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
213 | 239 | | |
214 | 240 | | |
215 | 241 | | |
| |||
233 | 259 | | |
234 | 260 | | |
235 | 261 | | |
| 262 | + | |
| 263 | + | |
236 | 264 | | |
| 265 | + | |
237 | 266 | | |
| 267 | + | |
238 | 268 | | |
239 | 269 | | |
240 | | - | |
241 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
242 | 275 | | |
243 | 276 | | |
244 | 277 | | |
| |||
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
286 | 287 | | |
287 | 288 | | |
288 | 289 | | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
289 | 296 | | |
290 | 297 | | |
291 | 298 | | |
| |||
294 | 301 | | |
295 | 302 | | |
296 | 303 | | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
297 | 315 | | |
298 | 316 | | |
299 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
300 | 322 | | |
301 | 323 | | |
302 | 324 | | |
| |||
0 commit comments