Skip to content

Commit 2a513a8

Browse files
committed
SPARK-38617 Minor refactoring and rewording of API class names
1 parent 3e0a4d3 commit 2a513a8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

sql/core/src/main/scala/org/apache/spark/status/api/v1/sql/SqlCompilerResource.scala

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ private[v1] class SqlCompilerResource extends BaseAppResource with Logging {
3838
val sqlStore = new SQLAppStatusStore(ui.store.store)
3939
sqlStore.executionsList(offset, length).map { exec =>
4040
val compileStats = sqlStore.getCompilerStats(exec.executionId)
41-
sqlStore
42-
.execution(exec.executionId)
43-
.map(prepareCompileData(_, compileStats)).getOrElse(null)
41+
prepareCompileData(exec, compileStats)
4442
}
4543
}
4644
}
@@ -66,11 +64,11 @@ private[v1] class SqlCompilerResource extends BaseAppResource with Logging {
6664
val phaseString = compileStats.split(QueryPlanningTracker.ruleHeader)
6765
val phaseListStr = phaseString.head.split(QueryPlanningTracker.phaseHeader)(1).
6866
split("\\r?\\n")
69-
val phaseTimes = new ListBuffer[PhaseTime]()
67+
val phaseTimes = new ListBuffer[Phase]()
7068
for(i <- 1 until phaseListStr.length by 2) {
7169
val phaseStr = phaseListStr(i).split(":")(1).trim
7270
val time = phaseListStr(i + 1).split(":")(1).trim
73-
phaseTimes += PhaseTime(phaseStr, time.toLong)
71+
phaseTimes += Phase(phaseStr, time.toLong)
7472
}
7573

7674
val rulesListStr = phaseString(1).trim().split("\\r?\\n")

sql/core/src/main/scala/org/apache/spark/status/api/v1/sql/api.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ExecutionData private[spark] (
3535

3636
class CompileData private[spark] (
3737
val executionId: Long,
38-
val phases: Seq[PhaseTime],
38+
val phases: Seq[Phase],
3939
val rules: Seq[Rule])
4040

4141
case class Rule private[spark](
@@ -52,6 +52,8 @@ case class Node private[spark](
5252

5353
case class Metric private[spark] (name: String, value: String)
5454

55+
case class Phase private[spark](phase: String, timeMs: Long)
56+
5557
class SQLDiagnosticData private[spark] (
5658
val id: Long,
5759
val physicalPlan: String,

0 commit comments

Comments
 (0)