From fa9f626ee69517a26b17a1d334bc2b9998ca0773 Mon Sep 17 00:00:00 2001 From: jiaoqingbo <1178404354@qq.com> Date: Mon, 31 Oct 2022 13:34:33 +0000 Subject: [PATCH] [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 --- .../kyuubi/engine/flink/operation/PlanOnlyStatement.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/externals/kyuubi-flink-sql-engine/src/main/scala/org/apache/kyuubi/engine/flink/operation/PlanOnlyStatement.scala b/externals/kyuubi-flink-sql-engine/src/main/scala/org/apache/kyuubi/engine/flink/operation/PlanOnlyStatement.scala index 2aabc9b06..afe04a307 100644 --- a/externals/kyuubi-flink-sql-engine/src/main/scala/org/apache/kyuubi/engine/flink/operation/PlanOnlyStatement.scala +++ b/externals/kyuubi-flink-sql-engine/src/main/scala/org/apache/kyuubi/engine/flink/operation/PlanOnlyStatement.scala @@ -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) }