kl0u commented on a change in pull request #10501: [FLINK-15139][table sql / 
client]misc end to end test failed  cause loss jars in converting to jobgraph
URL: https://github.com/apache/flink/pull/10501#discussion_r356013730
 
 

 ##########
 File path: 
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/ExecutionContext.java
 ##########
 @@ -310,6 +316,14 @@ private static Configuration createExecutionConfig(
                Configuration executionConfig = 
activeCommandLine.applyCommandLineOptionsToConfiguration(
                                commandLine);
 
+               try {
+                       final ProgramOptions programOptions = new 
ProgramOptions(commandLine);
+                       final ExecutionConfigAccessor executionConfigAccessor = 
ExecutionConfigAccessor.fromProgramOptions(programOptions, dependencies);
+                       ConfigUtils.encodeCollectionToConfig(executionConfig, 
PipelineOptions.JARS, executionConfigAccessor.getJars(), URL::toString);
+               } catch (CliArgsException e) {
+                       throw new SqlExecutionException("Invalid deployment run 
options.", e);
+               }
 
 Review comment:
   Actually both the `ProgramOptions` and the `executionConfig` are needed for 
the `flinkConfig` to be complete. This is the same as the 
`CliFrontend.getEffectiveConfiguration()` method.
   
   So I think that the re-parsing is correct but the:
   
   ```ConfigUtils.encodeCollectionToConfig(executionConfig, 
PipelineOptions.JARS, executionConfigAccessor.getJars(), URL::toString);```
   
   should become:
   
   ```executionConfigAccessor.applyToConfiguration(executionConfig);``` (in 
this order). 
   
   And the `ExecutionConfigAccessor.applyToConfiguration()` should become 
public.

----------------------------------------------------------------
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

Reply via email to