flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wei Zhong (Jira)" <j...@apache.org>
Subject [jira] [Created] (FLINK-14591) Execute PlannerBase#mergeParameters every time of calling PlannerBase#translate method
Date Fri, 01 Nov 2019 03:49:00 GMT
Wei Zhong created FLINK-14591:

             Summary:  Execute PlannerBase#mergeParameters every time of calling PlannerBase#translate
                 Key: FLINK-14591
                 URL: https://issues.apache.org/jira/browse/FLINK-14591
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / Planner
            Reporter: Wei Zhong

In current implementation of blink planner, the method "PlannerBase#mergeParameter" will be
called by "PlannerBase#translate" method to merge the configuration inside TableConfig into
global job parameters:
  override def translate(
      modifyOperations: util.List[ModifyOperation]): util.List[Transformation[_]] = {
    if (modifyOperations.isEmpty) {
      return List.empty[Transformation[_]]
    val relNodes = modifyOperations.map(translateToRel)
    val optimizedRelNodes = optimize(relNodes)
    val execNodes = translateToExecNodePlan(optimizedRelNodes)
This translate method is called in every important moment, e.g. execute, toDataStream, insertInto,

But as shown above, there is a chance that the method return directly and not call the "mergeParameters".

In fact if we set some configurations between the "Table#insertInto" method and "TableEnvironment#execute"
method, these configurations will not be merged into global job parameters because the "mergeParameters"
method is not called:
    val env = StreamExecutionEnvironment.getExecutionEnvironment
    val tEnv = StreamTableEnvironment.create(env, EnvironmentSettings.newInstance.useBlinkPlanner.build)
    val result = ...
    val sink = TestSinkUtil.configureSink(result, new TestingAppendTableSink)
    tEnv.registerTableSink("MySink", sink)
    tEnv.getConfig.getConfiguration.setString("jobparam1", "value1")
    // the "jobparam2" configuration will loss
    tEnv.getConfig.getConfiguration.setString("jobparam2", "value2")
    val jobConfig = env.getConfig.getGlobalJobParameters.toMap
    // this assertion will fail:
This may bring some confusion to the user. It will be great if we can fix this problem.


This message was sent by Atlassian Jira

View raw message