Commit 7437322
[SPARK-41442][SQL] Only update SQLMetric value if merging with valid metric (apache#1643)
### What changes were proposed in this pull request?
This patch updates how `SQLMetric` merges two invalid instances where the value is both -1.
### Why are the changes needed?
We use -1 as initial value of `SQLMetric`, and change it to 0 while merging with other `SQLMetric` instances. A `SQLMetric` will be treated as invalid and filtered out later.
While we are developing with Spark, it is trouble behavior that two invalid `SQLMetric` instances merge to a valid `SQLMetric` because merging will set the value to 0.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Existing tests.
Closes apache#38969 from viirya/minor_sql_metrics.
Authored-by: Liang-Chi Hsieh <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>1 parent c0bddf6 commit 7437322
File tree
3 files changed
+17
-4
lines changed- sql/core/src
- main/scala/org/apache/spark/sql/execution/metric
- test/scala/org/apache/spark/sql/execution
- adaptive
- metric
3 files changed
+17
-4
lines changedLines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
| |||
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1929 | 1929 | | |
1930 | 1930 | | |
1931 | 1931 | | |
1932 | | - | |
| 1932 | + | |
1933 | 1933 | | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
1934 | 1941 | | |
1935 | 1942 | | |
1936 | 1943 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
774 | 774 | | |
775 | 775 | | |
776 | 776 | | |
777 | | - | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
778 | 782 | | |
779 | 783 | | |
780 | 784 | | |
| |||
0 commit comments