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


##########
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 = tableConfig.getConfiguration();

Review Comment:
   For tableConfig, it'll overwrite conf from outer root. So, won't it more 
reasonal the conf in tableConfig has more priority  afer we reconstruct the 
Configuration?
   I mean we should first add root config and then add conf the table config;
   



##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/runtime/stream/sql/ProcedureITCase.java:
##########
@@ -210,6 +214,24 @@ void testNamedArgumentsWithOptionalArguments() {
                 ResolvedSchema.of(Column.physical("result", 
DataTypes.STRING())));
     }
 
+    @Test
+    void testEnvironmentConf() throws DatabaseAlreadyExistException {
+        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:
   also set a property table confg to make sure we can also get table confg;
   and set a property ("key1, "value2")  to table confg  to make sure the table 
conf overwrite the root conf
   



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