dianfu commented on a change in pull request #11448:
[FLINK-16666][python][table] Support new Python dependency configuration
options in flink-table.
URL: https://github.com/apache/flink/pull/11448#discussion_r405240775
##########
File path:
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/common/CommonPythonBase.scala
##########
@@ -85,9 +86,29 @@ trait CommonPythonBase {
}
}
- protected def getConfig(tableConfig: TableConfig): Configuration = {
- val config = new Configuration(tableConfig.getConfiguration)
+ protected def getConfig(
+ env: StreamExecutionEnvironment,
+ tableConfig: TableConfig): Configuration = {
+ val clazz = loadClass(CommonPythonBase.PYTHON_DEPENDENCY_UTILS_CLASS)
+ val method = clazz.getDeclaredMethod(
+ "configurePythonDependencies", classOf[java.util.List[_]],
classOf[Configuration])
+ val config = method.invoke(null, env.getCachedFiles,
getMergedConfiguration(env, tableConfig))
+ .asInstanceOf[Configuration]
config.setString("table.exec.timezone", tableConfig.getLocalTimeZone.getId)
config
}
+
+ protected def getMergedConfiguration(
Review comment:
Could you add some description on why we need to merge the configuration
from StreamExecutionEnvironment and TableConfig?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services