You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by GitBox <gi...@apache.org> on 2021/12/14 02:28:55 UTC

[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #1540: [KYUUBI #1539] Replace operationDetail with KyuubiEvent

yaooqinn commented on a change in pull request #1540:
URL: https://github.com/apache/incubator-kyuubi/pull/1540#discussion_r768269603



##########
File path: kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/OperationsResource.scala
##########
@@ -41,18 +41,23 @@ private[v1] class OperationsResource extends ApiRequestContext {
     content = Array(new Content(
       mediaType = MediaType.APPLICATION_JSON)),
     description =
-      "Get a statement event")
+      "Get a operation event")
   @GET
-  @Path("{operationHandle}/statementEvent")
-  def getStatementEvent(
-      @PathParam("operationHandle") operationHandleStr: String): KyuubiStatementEvent = {
+  @Path("{operationHandle}/event")
+  def getOperationEvent(
+      @PathParam("operationHandle") operationHandleStr: String): KyuubiServerEvent = {
     try {
-      val operation = backendService.sessionManager.operationManager
-        .getOperation(parseOperationHandle(operationHandleStr))
-      KyuubiStatementEvent(operation.asInstanceOf[ExecuteStatement])
+      val opHandle = parseOperationHandle(operationHandleStr)
+      val operation = backendService.sessionManager.operationManager.getOperation(opHandle)
+      opHandle.typ match {
+        case OperationType.EXECUTE_STATEMENT =>
+          KyuubiStatementEvent(operation.asInstanceOf[ExecuteStatement])

Review comment:
       what's the purpose of casting?




-- 
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: commits-unsubscribe@kyuubi.apache.org

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