You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/08/17 22:43:21 UTC

[GitHub] [spark] sarutak commented on a change in pull request #29442: [SPARK-32627][SQL][WEBUI] Add showSessionLink parameter to SqlStatsPagedTable class in ThriftServerPage

sarutak commented on a change in pull request #29442:
URL: https://github.com/apache/spark/pull/29442#discussion_r471813284



##########
File path: sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala
##########
@@ -206,18 +208,34 @@ private[ui] class SqlStatsPagedTable(
 
   override def headers: Seq[Node] = {
     val sqlTableHeadersAndTooltips: Seq[(String, Boolean, Option[String])] =
-      Seq(
-        ("User", true, None),
-        ("JobID", true, None),
-        ("GroupID", true, None),
-        ("Start Time", true, None),
-        ("Finish Time", true, Some(THRIFT_SERVER_FINISH_TIME)),
-        ("Close Time", true, Some(THRIFT_SERVER_CLOSE_TIME)),
-        ("Execution Time", true, Some(THRIFT_SERVER_EXECUTION)),
-        ("Duration", true, Some(THRIFT_SERVER_DURATION)),
-        ("Statement", true, None),
-        ("State", true, None),
-        ("Detail", true, None))
+      if (showSessionLink) {
+        Seq(
+          ("User", true, None),
+          ("JobID", true, None),
+          ("GroupID", true, None),
+          ("Session ID", true, None),
+          ("Start Time", true, None),
+          ("Finish Time", true, Some(THRIFT_SERVER_FINISH_TIME)),
+          ("Close Time", true, Some(THRIFT_SERVER_CLOSE_TIME)),
+          ("Execution Time", true, Some(THRIFT_SERVER_EXECUTION)),
+          ("Duration", true, Some(THRIFT_SERVER_DURATION)),
+          ("Statement", true, None),
+          ("State", true, None),
+          ("Detail", true, None))
+      } else {
+        Seq(
+          ("User", true, None),
+          ("JobID", true, None),
+          ("GroupID", true, None),
+          ("Start Time", true, None),
+          ("Finish Time", true, Some(THRIFT_SERVER_FINISH_TIME)),
+          ("Close Time", true, Some(THRIFT_SERVER_CLOSE_TIME)),
+          ("Execution Time", true, Some(THRIFT_SERVER_EXECUTION)),
+          ("Duration", true, Some(THRIFT_SERVER_DURATION)),
+          ("Statement", true, None),
+          ("State", true, None),
+          ("Detail", true, None))

Review comment:
       The code in the `if` block and the `else` block are almost same except for `("Session ID", true, None)`.
   Could you refactor the code?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org