Skip to content

Commit bc78f98

Browse files
amanomersrowen
authored andcommitted
[SPARK-29053][WEBUI][2.4] Sort does not work on some columns
### What changes were proposed in this pull request? Setting custom sort key for duration and execution time column. ### Why are the changes needed? 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). ### Does this PR introduce any user-facing change? No. ### How was this patch tested? Test manually. Back-port of commit 93ac4e1 Closes #25882 from amanomer/BP29053. Authored-by: aman_omer <[email protected]> Signed-off-by: Sean Owen <[email protected]>
1 parent 56cf17e commit bc78f98

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)