luoyuxia commented on code in PR #24397:
URL: https://github.com/apache/flink/pull/24397#discussion_r1507523379


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/operations/PlannerCallProcedureOperation.java:
##########
@@ -138,6 +137,14 @@ private Object[] getConvertedArgumentValues(
         return argumentVal;
     }
 
+    private ProcedureContext getProcedureContext(TableConfig tableConfig) {
+        Configuration configuration = (Configuration) 
tableConfig.getRootConfiguration();

Review Comment:
   Sorry for the mistake. Yes, it should be 
   Configuration configuration = new 
Configuration((Configuration)tableConfig.getRootConfiguration());



##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/runtime/stream/sql/ProcedureITCase.java:
##########
@@ -210,6 +214,31 @@ void testNamedArgumentsWithOptionalArguments() {
                 ResolvedSchema.of(Column.physical("result", 
DataTypes.STRING())));
     }
 
+    @Test
+    void testEnvironmentConf() throws DatabaseAlreadyExistException {
+        // root conf should work
+        Configuration configuration = new Configuration();
+        configuration.setString("key1", "value1");
+        StreamExecutionEnvironment env =
+                
StreamExecutionEnvironment.getExecutionEnvironment(configuration);
+        StreamTableEnvironment tableEnv = StreamTableEnvironment.create(env);
+        TestProcedureCatalogFactory.CatalogWithBuiltInProcedure 
procedureCatalog =
+                new 
TestProcedureCatalogFactory.CatalogWithBuiltInProcedure("procedure_catalog");
+        procedureCatalog.createDatabase(
+                "system", new CatalogDatabaseImpl(Collections.emptyMap(), 
null), true);
+        tableEnv.registerCatalog("test_p", procedureCatalog);
+        tableEnv.useCatalog("test_p");

Review Comment:
   That's right. Sorry for mistake.  I mean:
   you use  "key1" = "value1" to create root configuration.
   Then, set "key2" = "value2" to table configuration, then call the procedure.
   to make sure it can get from both table configuration and root configuration
   
   after that:
   you set "key1" = "value11" to table configuration, 
   then call the procedure.to make sure the table configuration will overwrite 
root configuration



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

Reply via email to