https://github.com/apache/spark
Revision 674feecc47785fff84ee4496f4a49b1703c40555 authored by Yimin on 22 March 2022, 10:24:12 UTC, committed by Yuming Wang on 22 March 2022, 10:25:33 UTC
### What changes were proposed in this pull request?

Added null check for `exec.metricValues`.

### Why are the changes needed?

When requesting Restful API  {baseURL}/api/v1/applications/$appId/sql/$executionId which is introduced by this PR https://github.com/apache/spark/pull/28208, it can cause NullPointerException. The root cause is, when calling method doUpdate() of `LiveExecutionData`, `metricsValues` can be null. Then, when statement `printableMetrics(graph.allNodes, exec.metricValues)` is executed, it will throw NullPointerException.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Tested manually.

Closes #35884 from yym1995/fix-npe.

Lead-authored-by: Yimin <yimin.y@outlook.com>
Co-authored-by: Yimin Yang <26797163+yym1995@users.noreply.github.com>
Signed-off-by: Yuming Wang <yumwang@ebay.com>
(cherry picked from commit 99992a4e050a00564049be6938f5734876c17518)
Signed-off-by: Yuming Wang <yumwang@ebay.com>
1 parent 7a607b7
History
Tip revision: 674feecc47785fff84ee4496f4a49b1703c40555 authored by Yimin on 22 March 2022, 10:24:12 UTC
[SPARK-38579][SQL][WEBUI] Requesting Restful API can cause NullPointerException
Tip revision: 674feec

README.md

back to top