turboFei commented on code in PR #2583:
URL: https://github.com/apache/incubator-kyuubi/pull/2583#discussion_r867335807


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala:
##########
@@ -157,8 +157,9 @@ class KyuubiSessionManager private (name: String) extends 
SessionManager(name) {
 
   def getBatchSessionList(batchType: String, from: Int, size: Int): 
Seq[Session] = {
     allSessions().filter {
-      case batchSession: KyuubiBatchSessionImpl =>
+      case batchSession: KyuubiBatchSessionImpl if batchType != null =>
         batchSession.batchJobSubmissionOp.batchType.equalsIgnoreCase(batchType)
+      case _: KyuubiBatchSessionImpl => true
       case _ => false
     }.toSeq.sortBy(_.handle.identifier.toString).slice(from, from + size)

Review Comment:
   > we can pull out the condition:
   > 
   > ```
   > val sessions = if (isnull) all else ...
   > session.toSeq.sortBy..
   > ```
   
   +1



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