Github user aarondav commented on a diff in the pull request:

    https://github.com/apache/spark/pull/421#discussion_r11796306
  
    --- Diff: core/src/main/scala/org/apache/spark/ui/jobs/StageTable.scala ---
    @@ -27,34 +27,36 @@ import org.apache.spark.ui.UIUtils
     import org.apache.spark.util.Utils
     
     /** Page showing list of all ongoing and recently finished stages */
    -private[ui] class StageTable(
    +private[ui] class StageTableBase(
         stages: Seq[StageInfo],
         parent: JobProgressTab,
         killEnabled: Boolean = false) {
     
       private val basePath = parent.basePath
       private val listener = parent.listener
    -  private lazy val isFairScheduler = parent.isFairScheduler
    +  protected def isFairScheduler = parent.isFairScheduler
    +
    +  protected def columns: Seq[Any] = {
    +    {<th>Stage Id</th>} ++
    --- End diff --
    
    The prettiest way to do this may be to actually wrap it in a dummy xml 
element like:
    ```
    protected def columns: Seq[Node] = {
      // Use dummy element to wrap the list of columns.
      <dummy>
        <th>Stage Id</th>
        {if (isFairScheduler) {...}
        ...
      </dummy>.child
    }
    ```
    
    The problem is that the XML DSL is so evil that I think we need to either 
go all the way or avoid it altogether (and we're in too deep to easily avoid it 
now). All these braces just bring up questions that are better left unasked. 
For instance, `Seq{if (isFairScheduler) {<th>Pool Name</th>} else {}}` actually 
returns either a Seq(Node) or a Seq(Unit), which makes virtually no sense, but 
results in the Seq[Any] you're currently returning.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to