Skip to content

Commit 0f0708b

Browse files
wForgetturboFei
authored andcommitted
[KYUUBI #2493][FOLLOWUP] Fix the exception that occurred when beeline rendered spark progress
### _Why are the changes needed?_ followup #2493 As discussed in #2529 (comment), we still need to add the last empty column to prevent exceptions when the beeline renders spark progress. ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [X] Add screenshots for manual tests if appropriate ![image](https://user-images.githubusercontent.com/17894939/167349075-b9ab7e40-2941-4d33-824f-1e7bcc5f3838.png) ![image](https://user-images.githubusercontent.com/17894939/167349125-61ef4ef5-40d0-4986-8c06-bc48b065ec3a.png) - [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #2600 from wForget/KYUUBI-2493-1. Closes #2493 cd67e18 [wforget] [KYUUBI-2493][FOLLOWUP] Fix the exception that occurred when beeline rendered spark progress Authored-by: wforget <643348094@qq.com> Signed-off-by: Fei Wang <fwang12@ebay.com>
1 parent 8c1fc10 commit 0f0708b

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/spark/kyuubi/SparkProgressMonitor.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ class SparkProgressMonitor(spark: SparkSession, jobGroup: String) {
9090
String.valueOf(complete),
9191
String.valueOf(running),
9292
String.valueOf(pending),
93-
String.valueOf(failed))
93+
String.valueOf(failed),
94+
"")
9495
}.toList.asJavaCollection
9596
new util.ArrayList[util.List[String]](progressRows)
9697
}
@@ -165,7 +166,8 @@ object SparkProgressMonitor {
165166
"COMPLETED",
166167
"RUNNING",
167168
"PENDING",
168-
"FAILED")
169+
"FAILED",
170+
"")
169171

170172
private val COLUMN_1_WIDTH = 16
171173

externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/SparkOperationProgressSuite.scala

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,16 @@ class SparkOperationProgressSuite extends WithSparkSQLEngine with HiveJDBCTestHe
6868
"COMPLETED",
6969
"RUNNING",
7070
"PENDING",
71-
"FAILED"))(headers.asScala)
71+
"FAILED",
72+
""))(headers.asScala)
7273
assert(rows.size() == 1)
7374
progress match {
7475
case 0.0 =>
75-
assert(Seq(s"Stage-$initStageId ", "0", "PENDING", "2", "0", "0", "2", "0")
76+
assert(Seq(s"Stage-$initStageId ", "0", "PENDING", "2", "0", "0", "2", "0", "")
7677
== rows.get(0).asScala ||
77-
Seq(s"Stage-$initStageId ", "0", "RUNNING", "2", "0", "1", "1", "0")
78+
Seq(s"Stage-$initStageId ", "0", "RUNNING", "2", "0", "1", "1", "0", "")
7879
== rows.get(0).asScala ||
79-
Seq(s"Stage-$initStageId ", "0", "RUNNING", "2", "0", "2", "0", "0")
80+
Seq(s"Stage-$initStageId ", "0", "RUNNING", "2", "0", "2", "0", "0", "")
8081
== rows.get(0).asScala)
8182
assert("STAGES: 00/01" === footerSummary)
8283
assert(TJobExecutionStatus.IN_PROGRESS === status)
@@ -90,7 +91,8 @@ class SparkOperationProgressSuite extends WithSparkSQLEngine with HiveJDBCTestHe
9091
"1",
9192
"1",
9293
"0",
93-
"0"))(
94+
"0",
95+
""))(
9496
rows.get(0).asScala)
9597
assert("STAGES: 00/01" === footerSummary)
9698
assert(TJobExecutionStatus.IN_PROGRESS === status)
@@ -104,7 +106,8 @@ class SparkOperationProgressSuite extends WithSparkSQLEngine with HiveJDBCTestHe
104106
"2",
105107
"0",
106108
"0",
107-
"0"))(
109+
"0",
110+
""))(
108111
rows.get(0).asScala)
109112
assert("STAGES: 01/01" === footerSummary)
110113
checkFlag3 = true

0 commit comments

Comments
 (0)