Skip to content

Commit b1978d2

Browse files
committed
[SPARK-29053][WEBUI] Sort does not work on some columns
Setting custom sort key for duration and execution time column. Sorting on duration and execution time columns consider time as a string after converting into readable form which is the reason for wrong sort results as mentioned in [SPARK-29053](https://issues.apache.org/jira/browse/SPARK-29053). No Test manually. Screenshots are attached. After patch: **Duration** ![Duration](https://user-images.githubusercontent.com/40591404/65339861-93cc9800-dbea-11e9-95e6-63b107a5a372.png) **Execution time** ![Execution Time](https://user-images.githubusercontent.com/40591404/65339870-97601f00-dbea-11e9-9d1d-690c59bc1bde.png) Closes #25855 from amanomer/SPARK29053. Authored-by: aman_omer <amanomer1996@gmail.com> Signed-off-by: Sean Owen <sean.owen@databricks.com>
1 parent 25d4b3a commit b1978d2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ private[ui] class ThriftServerPage(parent: ThriftServerTab) extends WebUIPage(""
9090
<td>{info.groupId}</td>
9191
<td>{formatDate(info.startTimestamp)}</td>
9292
<td>{if (info.finishTimestamp > 0) formatDate(info.finishTimestamp)}</td>
93-
<td>{formatDurationOption(Some(info.totalTime))}</td>
93+
<td sorttable_customkey={info.totalTime.toString}>
94+
{formatDurationOption(Some(info.totalTime))}</td>
9495
<td>{info.statement}</td>
9596
<td>{info.state}</td>
9697
{errorMessageCell(detail)}
@@ -155,7 +156,8 @@ private[ui] class ThriftServerPage(parent: ThriftServerTab) extends WebUIPage(""
155156
<td> <a href={sessionLink}> {session.sessionId} </a> </td>
156157
<td> {formatDate(session.startTimestamp)} </td>
157158
<td> {if (session.finishTimestamp > 0) formatDate(session.finishTimestamp)} </td>
158-
<td> {formatDurationOption(Some(session.totalTime))} </td>
159+
<td sorttable_customkey={session.totalTime.toString}>
160+
{formatDurationOption(Some(session.totalTime))} </td>
159161
<td> {session.totalExecution.toString} </td>
160162
</tr>
161163
}

0 commit comments

Comments
 (0)