You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/08/11 07:16:11 UTC

[GitHub] [incubator-kyuubi] yaooqinn commented on pull request #3216: [KYUUBI #3214] Plan only mode should unset when mode value is incorrect

yaooqinn commented on PR #3216:
URL: https://github.com/apache/incubator-kyuubi/pull/3216#issuecomment-1211631711

   I suggest 
   - we implement it in `OperationModes` for reuse in different engines.
   - redirect unrecognized modes to NONE with a warning message, it has a deterministic behavior which does not rely on kyuubi.operation.plan.only.excludes
   
   ```scala
     object OperationModes extends Enumeration with Logging {
       type OperationMode = Value
       val PARSE, ANALYZE, OPTIMIZE, PHYSICAL, EXECUTION, NONE = Value
   
       def apply(mode: String): OperationMode = {
         mode.toUpperCase(Locale.ROOT) match {
           case "PARSE" => PARSE
           case "ANALYZE" => ANALYZE
           case "OPTIMIZE" => OPTIMIZE
           case "PHYSICAL" => PHYSICAL
           case "EXECUTION" => EXECUTION
           case "NONE" => NONE
           case other =>
             warn(s"Unsupported operation mode: $mode, using NONE instead")
             NONE
         }
       }
     }
   ```
   
   Accordingly in OperationManagers,
   ```scala
          case OperationLanguages.SQL =>
             val mode =
               OperationModes(spark.conf.get(OPERATION_PLAN_ONLY_MODE.key, operationModeDefault))
             mode match {
               case NONE =>
                 val incrementalCollect = spark.conf.getOption(OPERATION_INCREMENTAL_COLLECT.key)
                   .map(_.toBoolean).getOrElse(operationIncrementalCollectDefault)
                 new ExecuteStatement(session, statement, runAsync, queryTimeout, incrementalCollect)
               case mode =>
                 new PlanOnlyStatement(session, statement, mode)
             }
   
   ```


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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org