You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampark.apache.org by be...@apache.org on 2022/11/15 06:09:53 UTC

[incubator-streampark] branch dev updated: [fix] Remove hive sql statement validate. (#2011)

This is an automated email from the ASF dual-hosted git repository.

benjobs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git


The following commit(s) were added to refs/heads/dev by this push:
     new 10be6ec3b [fix] Remove hive sql statement validate. (#2011)
10be6ec3b is described below

commit 10be6ec3b4b76c0d3dd08a5b4192b7c83a17aee0
Author: 第一片心意 <10...@users.noreply.github.com>
AuthorDate: Tue Nov 15 14:09:48 2022 +0800

    [fix] Remove hive sql statement validate. (#2011)
---
 .../apache/streampark/flink/core/FlinkSqlValidator.scala    | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/streampark-flink/streampark-flink-shims/streampark-flink-shims-base/src/main/scala/org/apache/streampark/flink/core/FlinkSqlValidator.scala b/streampark-flink/streampark-flink-shims/streampark-flink-shims-base/src/main/scala/org/apache/streampark/flink/core/FlinkSqlValidator.scala
index 5b0f4389c..6b5da1647 100644
--- a/streampark-flink/streampark-flink-shims/streampark-flink-shims-base/src/main/scala/org/apache/streampark/flink/core/FlinkSqlValidator.scala
+++ b/streampark-flink/streampark-flink-shims/streampark-flink-shims-base/src/main/scala/org/apache/streampark/flink/core/FlinkSqlValidator.scala
@@ -84,16 +84,15 @@ object FlinkSqlValidator extends Logger {
           Try {
             val calciteClass = Try(Class.forName(FLINK112_CALCITE_PARSER_CLASS)).getOrElse(Class.forName(FLINK113_PLUS_CALCITE_PARSER_CLASS))
             sqlDialect.toUpperCase() match {
-              case "HIVE" | "DEFAULT" =>
+              case "HIVE" =>
+              case "DEFAULT" =>
+                val parser = calciteClass.getConstructor(Array(classOf[Config]): _*).newInstance(sqlParserConfigMap(sqlDialect.toUpperCase()))
+                val method = parser.getClass.getDeclaredMethod("parse", classOf[String])
+                method.setAccessible(true)
+                method.invoke(parser, call.originSql)
               case _ =>
                 throw new UnsupportedOperationException(s"unsupported dialect: ${sqlDialect}")
             }
-
-            val parser = calciteClass.getConstructor(Array(classOf[Config]): _*).newInstance(sqlParserConfigMap(sqlDialect.toUpperCase()))
-            val method = parser.getClass.getDeclaredMethod("parse", classOf[String])
-            method.setAccessible(true)
-            method.invoke(parser, call.originSql)
-
           } match {
             case Failure(e) =>
               val exception = ExceptionUtils.stringifyException(e)