Skip to content

Commit da43acc

Browse files
wangyumamanomer
authored andcommitted
[SPARK-28599][SQL] Fix Execution Time and Duration column sorting for ThriftServerSessionPage
This PR add support sorting `Execution Time` and `Duration` columns for `ThriftServerSessionPage`. Previously, it's not sorted correctly. Yes. Manually do the following and test sorting on those columns in the Spark Thrift Server Session Page. ``` $ sbin/start-thriftserver.sh $ bin/beeline -u jdbc:hive2://localhost:10000 0: jdbc:hive2://localhost:10000> create table t(a int); +---------+--+ | Result | +---------+--+ +---------+--+ No rows selected (0.521 seconds) 0: jdbc:hive2://localhost:10000> select * from t; +----+--+ | a | +----+--+ +----+--+ No rows selected (0.772 seconds) 0: jdbc:hive2://localhost:10000> show databases; +---------------+--+ | databaseName | +---------------+--+ | default | +---------------+--+ 1 row selected (0.249 seconds) ``` **Sorted by `Execution Time` column**: ![image](https://user-images.githubusercontent.com/5399861/65387476-53038900-dd7a-11e9-885c-fca80287f550.png) **Sorted by `Duration` column**: ![image](https://user-images.githubusercontent.com/5399861/65387481-6e6e9400-dd7a-11e9-9318-f917247efaa8.png) Closes #25892 from wangyum/SPARK-28599. Authored-by: Yuming Wang <yumwang@ebay.com> Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
1 parent 328c4ec commit da43acc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ private[ui] class ThriftServerSessionPage(parent: ThriftServerTab)
100100
<td>{info.groupId}</td>
101101
<td>{formatDate(info.startTimestamp)}</td>
102102
<td>{formatDate(info.finishTimestamp)}</td>
103-
<td>{formatDurationOption(Some(info.totalTime))}</td>
103+
<td sorttable_customkey={info.totalTime.toString}>
104+
{formatDurationOption(Some(info.totalTime))}</td>
104105
<td>{info.statement}</td>
105106
<td>{info.state}</td>
106107
{errorMessageCell(detail)}

0 commit comments

Comments
 (0)