-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[SPARK-12708][UI] Sorting task error in Stages Page when yarn mode. #10663
Changes from 1 commit
fc45425
62c04ca
3678e30
3d508c6
384b990
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 |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
package org.apache.spark.ui.jobs | ||
|
||
import java.net.URLEncoder | ||
import java.net.URLDecoder | ||
import java.util.Date | ||
import javax.servlet.http.HttpServletRequest | ||
|
||
|
@@ -100,7 +101,19 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") { | |
val parameterTaskPrevPageSize = request.getParameter("task.prevPageSize") | ||
|
||
val taskPage = Option(parameterTaskPage).map(_.toInt).getOrElse(1) | ||
val taskSortColumn = Option(parameterTaskSortColumn).getOrElse("Index") | ||
val taskSortColumn = Option(parameterTaskSortColumn).map { | ||
sortColumn => | ||
// If sortColumn contains "/", `getParameter("task.sort")` will return | ||
// "%252F" when yarn mode. we need additional decode. | ||
// See also SPARK-4313, YARN-2844. | ||
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. How about saying like as follows?
|
||
var column = sortColumn | ||
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. Since this is very similar to 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. +1; good to reduce duplication here. 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. Make sense. |
||
var decodedColumn = URLDecoder.decode(column, "UTF-8") | ||
while (column != decodedColumn) { | ||
column = decodedColumn | ||
decodedColumn = URLDecoder.decode(column, "UTF-8") | ||
} | ||
column | ||
}.getOrElse("Index") | ||
val taskSortDesc = Option(parameterTaskSortDesc).map(_.toBoolean).getOrElse(false) | ||
val taskPageSize = Option(parameterTaskPageSize).map(_.toInt).getOrElse(100) | ||
val taskPrevPageSize = Option(parameterTaskPrevPageSize).map(_.toInt).getOrElse(taskPageSize) | ||
|
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.
sortColumn
should be on previous line like.map { sortColumn =>