-
Notifications
You must be signed in to change notification settings - Fork 29.2k
[SPARK-20966][WEB-UI][SQL]Table data is not sorted by startTime time desc, time is not formatted and redundant code in JDBC/ODBC Server page. #18186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d383efb
3059013
555cef8
46bb1ad
0efb0dd
0e37fde
52641bb
d3977c9
137b90e
0fe5865
cf6f42a
685cd6b
c716a92
679cec3
3c9387a
cb71f44
ce92a74
dd64342
bffd2bd
588d42a
4bbeee1
362e5ad
4ed5e00
d871e01
a1f7759
dc56cdf
c999cf7
685dd8c
b744ceb
84a50f2
402b5f7
4867780
c1b1e38
85752db
172c872
6e60cc7
4c3dbeb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,7 +66,7 @@ private[ui] class ThriftServerSessionPage(parent: ThriftServerTab) | |
| val timeSinceStart = System.currentTimeMillis() - startTime.getTime | ||
| <ul class ="unstyled"> | ||
| <li> | ||
| <strong>Started at: </strong> {startTime.toString} | ||
| <strong>Started at: </strong> {formatDate(startTime)} | ||
| </li> | ||
| <li> | ||
| <strong>Time since start: </strong>{formatDurationVerbose(timeSinceStart)} | ||
|
|
@@ -147,42 +147,6 @@ private[ui] class ThriftServerSessionPage(parent: ThriftServerTab) | |
| <td>{errorSummary}{details}</td> | ||
| } | ||
|
|
||
| /** Generate stats of batch sessions of the thrift server program */ | ||
| private def generateSessionStatsTable(): Seq[Node] = { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From what I can tell this has never been used, is this something that should be used rather than deleted? I have't worked in the ThiftSever UI much so I'm not sure myself.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the whole spark project, I did not find this method where it was used. When I remove this method to recompile the package test, I did not find any problems with this ThiftSever ui. SoI think can remove this method because it is redundant code. Thanks.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's also a method like this in
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, It's dead code.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @srowen
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @srowen |
||
| val sessionList = listener.getSessionList | ||
| val numBatches = sessionList.size | ||
| val table = if (numBatches > 0) { | ||
| val dataRows = | ||
| sessionList.sortBy(_.startTimestamp).reverse.map ( session => | ||
| Seq( | ||
| session.userName, | ||
| session.ip, | ||
| session.sessionId, | ||
| formatDate(session.startTimestamp), | ||
| formatDate(session.finishTimestamp), | ||
| formatDurationOption(Some(session.totalTime)), | ||
| session.totalExecution.toString | ||
| ) | ||
| ).toSeq | ||
| val headerRow = Seq("User", "IP", "Session ID", "Start Time", "Finish Time", "Duration", | ||
| "Total Execute") | ||
| Some(listingTable(headerRow, dataRows)) | ||
| } else { | ||
| None | ||
| } | ||
|
|
||
| val content = | ||
| <h5>Session Statistics</h5> ++ | ||
| <div> | ||
| <ul class="unstyled"> | ||
| {table.getOrElse("No statistics have been generated yet.")} | ||
| </ul> | ||
| </div> | ||
|
|
||
| content | ||
| } | ||
|
|
||
|
|
||
| /** | ||
| * Returns a human-readable string representing a duration such as "5 second 35 ms" | ||
| */ | ||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was this sorted by before? Was there a reason it was that way? If there wasn't, I'm ok with this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the ThriftServerSessionPage.scala, this sorted is order by startTimestamp desc.
But in the ThriftServerPage.scala, this sorted by before is default, this sorted is not order by startTimestamp desc.
So sort by time in reverse order is in line with spark UI style.