[KYUUBI #3732] Add logic for judging flink version in AddJarOperation and ShowJarsOperation

### _Why are the changes needed?_

fix #3732

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #3733 from jiaoqingbo/kyuubi3732.

Closes #3732

1b1625b0 [jiaoqingbo] [KYUUBI #3732] Add logic for judging flink version in AddJarOperation and ShowJarsOperation

Authored-by: jiaoqingbo <1178404354@qq.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
This commit is contained in:
jiaoqingbo 2022-10-31 13:34:33 +00:00 committed by Cheng Pan
parent 08b38c8c8c
commit fa9f626ee6

View File

@ -20,6 +20,7 @@ package org.apache.kyuubi.engine.flink.operation
import org.apache.flink.table.api.TableEnvironment
import org.apache.flink.table.operations.command._
import org.apache.kyuubi.engine.flink.FlinkEngineUtils.isFlinkVersionAtMost
import org.apache.kyuubi.engine.flink.result.ResultSetUtil
import org.apache.kyuubi.operation.{ExecutionMode, ParseMode, PhysicalMode, PlanOnlyMode, UnknownMode}
import org.apache.kyuubi.operation.PlanOnlyMode.{notSupportedModeError, unknownModeError}
@ -51,11 +52,11 @@ class PlanOnlyStatement(
resultSet = OperationUtils.runSetOperation(setOperation, executor, sessionId)
case resetOperation: ResetOperation =>
resultSet = OperationUtils.runResetOperation(resetOperation, executor, sessionId)
case addJarOperation: AddJarOperation =>
case addJarOperation: AddJarOperation if isFlinkVersionAtMost("1.15") =>
resultSet = OperationUtils.runAddJarOperation(addJarOperation, executor, sessionId)
case removeJarOperation: RemoveJarOperation =>
resultSet = OperationUtils.runRemoveJarOperation(removeJarOperation, executor, sessionId)
case showJarsOperation: ShowJarsOperation =>
case showJarsOperation: ShowJarsOperation if isFlinkVersionAtMost("1.15") =>
resultSet = OperationUtils.runShowJarOperation(showJarsOperation, executor, sessionId)
case _ => explainOperation(statement)
}