Commit f184c25
committed
[SPARK-56361][SS] Provide better error with logging on NPE in stream-stream join
### What changes were proposed in this pull request?
This PR proposes to provide better error with additional logging on NPE in stream-stream join.
We have captured several places which could throw NPE - this PR provides the better error for users which is less cryptic and gives a quick mitigation if they are willing to tolerate losing some data to keep the query running. For devs, this PR leaves the context to the log, so that when users come to devs with the error, devs can at least know where to start looking into.
### Why are the changes needed?
Throwing NPE does not help anything for users and devs. For users, NPE is mostly cryptic error and they know nothing what to do to mitigate the issue. There is no information around context, so debugging is almost impossible for devs when this happens.
### Does this PR introduce _any_ user-facing change?
Yes, users would no longer get NPE from stream-stream join for known places on potential NPE, and will get better exception with the guidance for quick mitigation (toleration of data loss).
### How was this patch tested?
Modified test
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude 4.6 Opus
Closes #55214 from HeartSaVioR/SPARK-56361.
Authored-by: Jungtaek Lim <kabhwan.opensource@gmail.com>
Signed-off-by: Jungtaek Lim <kabhwan.opensource@gmail.com>1 parent ae7f6e3 commit f184c25
5 files changed
Lines changed: 98 additions & 19 deletions
File tree
- common
- utils-java/src/main/java/org/apache/spark/internal
- utils/src/main/resources/error
- sql/core/src
- main/scala/org/apache/spark/sql/execution/streaming
- operators/stateful/join
- state
- test/scala/org/apache/spark/sql/execution/streaming/state
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
| 322 | + | |
322 | 323 | | |
323 | 324 | | |
324 | 325 | | |
| |||
537 | 538 | | |
538 | 539 | | |
539 | 540 | | |
| 541 | + | |
540 | 542 | | |
541 | 543 | | |
542 | 544 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6769 | 6769 | | |
6770 | 6770 | | |
6771 | 6771 | | |
| 6772 | + | |
| 6773 | + | |
| 6774 | + | |
| 6775 | + | |
| 6776 | + | |
| 6777 | + | |
| 6778 | + | |
| 6779 | + | |
| 6780 | + | |
| 6781 | + | |
| 6782 | + | |
| 6783 | + | |
| 6784 | + | |
| 6785 | + | |
| 6786 | + | |
6772 | 6787 | | |
6773 | 6788 | | |
6774 | 6789 | | |
| |||
Lines changed: 47 additions & 8 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 | | |
| |||
1025 | 1025 | | |
1026 | 1026 | | |
1027 | 1027 | | |
1028 | | - | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
1029 | 1031 | | |
1030 | 1032 | | |
1031 | 1033 | | |
| |||
1265 | 1267 | | |
1266 | 1268 | | |
1267 | 1269 | | |
1268 | | - | |
1269 | | - | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
1270 | 1274 | | |
1271 | 1275 | | |
1272 | 1276 | | |
| |||
1277 | 1281 | | |
1278 | 1282 | | |
1279 | 1283 | | |
1280 | | - | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
1281 | 1287 | | |
1282 | 1288 | | |
1283 | 1289 | | |
| |||
1328 | 1334 | | |
1329 | 1335 | | |
1330 | 1336 | | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
1331 | 1371 | | |
1332 | 1372 | | |
1333 | 1373 | | |
| |||
1609 | 1649 | | |
1610 | 1650 | | |
1611 | 1651 | | |
1612 | | - | |
1613 | | - | |
1614 | 1652 | | |
1615 | 1653 | | |
1616 | 1654 | | |
| |||
1623 | 1661 | | |
1624 | 1662 | | |
1625 | 1663 | | |
1626 | | - | |
| 1664 | + | |
| 1665 | + | |
1627 | 1666 | | |
1628 | 1667 | | |
1629 | 1668 | | |
| |||
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
309 | 320 | | |
310 | 321 | | |
311 | 322 | | |
| |||
674 | 685 | | |
675 | 686 | | |
676 | 687 | | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
Lines changed: 6 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
329 | 330 | | |
330 | 331 | | |
331 | 332 | | |
332 | | - | |
333 | | - | |
| 333 | + | |
| 334 | + | |
334 | 335 | | |
335 | 336 | | |
336 | 337 | | |
| |||
342 | 343 | | |
343 | 344 | | |
344 | 345 | | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
354 | 349 | | |
355 | 350 | | |
356 | 351 | | |
| |||
0 commit comments