yabola commented on code in PR #38882:
URL: https://github.com/apache/spark/pull/38882#discussion_r1037993126


##########
core/src/main/scala/org/apache/spark/status/api/v1/StagesResource.scala:
##########
@@ -143,7 +148,10 @@ private[v1] class StagesResource extends BaseAppResource {
     @Context uriInfo: UriInfo):
   HashMap[String, Object] = {
     withUI { ui =>
-      val uriQueryParameters = uriInfo.getQueryParameters(true)
+      // Decode URI twice here to avoid percent-encoding twice on the query 
string
+      val decodeURI = URLDecoder.decode(uriInfo.getRequestUri.getRawQuery, 
UTF_8.name())
+      val uriQueryParameters = new ImmutableMultivaluedMap[String, String](
+        UriComponent.decodeQuery(decodeURI, true))

Review Comment:
   Not sure if decoding twice is appropriate here.
   If do not change here, the stage page can be opened, but the task sort 
column button cannot be clicked (locality level etc.)



##########
core/src/main/scala/org/apache/spark/status/api/v1/StagesResource.scala:
##########
@@ -204,7 +212,7 @@ private[v1] class StagesResource extends BaseAppResource {
       pageLength = queryParameters.getFirst("length").toInt
     }
     withUI(_.store.taskList(stageId, stageAttemptId, pageStartIndex, 
pageLength,
-      indexName(columnNameToSort), isAscendingStr.equalsIgnoreCase("asc")))
+      indexName(columnNameToSort), "asc".equalsIgnoreCase(isAscendingStr)))

Review Comment:
   `isAscendingStr` may be NPE if URI was encoded twice.
   After change here, at least the stage page can be opened now 



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to