pan3793 commented on code in PR #5585:
URL: https://github.com/apache/kyuubi/pull/5585#discussion_r1378883020
##########
externals/kyuubi-flink-sql-engine/src/main/scala/org/apache/kyuubi/engine/flink/operation/ExecuteStatement.scala:
##########
@@ -71,4 +85,33 @@ class ExecuteStatement(
shutdownTimeoutMonitor()
}
}
+
+ private def parseExtendedStatement(statement: String): Optional[Operation] =
{
+ val plannerModuleClassLoader: ClassLoader = getPlannerModuleClassLoader
+ val extendedParser: AnyRef =
+ DynConstructors.builder()
+ .loader(plannerModuleClassLoader)
+ .impl("org.apache.flink.table.planner.parse.ExtendedParser")
+ .build().newInstance()
+ DynMethods.builder("parse")
+ .hiddenImpl(extendedParser.getClass, classOf[String])
+ .buildChecked()
+ .invoke(extendedParser, statement)
+ }
+
+ private def getPlannerModuleClassLoader: ClassLoader = {
+ try {
+ val plannerModule = DynMethods.builder("getInstance")
+ .hiddenImpl("org.apache.flink.table.planner.loader.PlannerModule")
+ .buildStaticChecked()
+ .invoke().asInstanceOf[AnyRef]
+
+ DynFields.builder()
+ .hiddenImpl(plannerModule.getClass, "submoduleClassLoader")
+ .build[ClassLoader].bind(plannerModule).get
+ } catch {
+ case e: Exception =>
+ throw new TableException("Error obtaining Flink planner module
ClassLoader", e)
Review Comment:
Could we add some messages to guide users on how to fix it?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]