This is an automated email from the ASF dual-hosted git repository.
srowen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 93ac4e1 [SPARK-29053][WEBUI] Sort does not work on some columns
93ac4e1 is described below
commit 93ac4e1b2df5ca1dde29010320c6faead537a7b1
Author: aman_omer <[email protected]>
AuthorDate: Sat Sep 21 07:34:04 2019 -0500
[SPARK-29053][WEBUI] 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. Screenshots are attached.
After patch:
**Duration**

**Execution time**

Closes #25855 from amanomer/SPARK29053.
Authored-by: aman_omer <[email protected]>
Signed-off-by: Sean Owen <[email protected]>
---
.../apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git
a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala
b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala
index 261e8fc..1a7db1b 100644
---
a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala
+++
b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala
@@ -91,8 +91,10 @@ private[ui] class ThriftServerPage(parent: ThriftServerTab)
extends WebUIPage(""
<td>{formatDate(info.startTimestamp)}</td>
<td>{if (info.finishTimestamp > 0)
formatDate(info.finishTimestamp)}</td>
<td>{if (info.closeTimestamp > 0)
formatDate(info.closeTimestamp)}</td>
-
<td>{formatDurationOption(Some(info.totalTime(info.finishTimestamp)))}</td>
-
<td>{formatDurationOption(Some(info.totalTime(info.closeTimestamp)))}</td>
+ <td
sorttable_customkey={info.totalTime(info.finishTimestamp).toString}>
+ {formatDurationOption(Some(info.totalTime(info.finishTimestamp)))}
</td>
+ <td
sorttable_customkey={info.totalTime(info.closeTimestamp).toString}>
+ {formatDurationOption(Some(info.totalTime(info.closeTimestamp)))}
</td>
<td>{info.statement}</td>
<td>{info.state}</td>
{errorMessageCell(detail)}
@@ -157,7 +159,8 @@ private[ui] class ThriftServerPage(parent: ThriftServerTab)
extends WebUIPage(""
<td> <a href={sessionLink}> {session.sessionId} </a> </td>
<td> {formatDate(session.startTimestamp)} </td>
<td> {if (session.finishTimestamp > 0)
formatDate(session.finishTimestamp)} </td>
- <td> {formatDurationOption(Some(session.totalTime))} </td>
+ <td sorttable_customkey={session.totalTime.toString}>
+ {formatDurationOption(Some(session.totalTime))} </td>
<td> {session.totalExecution.toString} </td>
</tr>
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]