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


##########
flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/HiveDialectITCase.java:
##########
@@ -807,6 +807,29 @@ public void testShowPartitions() throws Exception {
         assertTrue(partitions.toString().contains("dt=2020-04-30 
01:02:03/country=china"));
     }
 
+    @Test
+    public void testStatementVariableSubstitution() {
+        // test system variable for substitution
+        System.setProperty("k1", "v1");
+        List<Row> result =
+                CollectionUtil.iteratorToList(
+                        tableEnv.executeSql("select 
'${system:k1}'").collect());
+        assertEquals("[+I[v1]]", result.toString());
+
+        // test env variable for substitution
+        String classPath = System.getenv("CLASSPATH");
+        result =
+                CollectionUtil.iteratorToList(
+                        tableEnv.executeSql("select 
'${env:CLASSPATH}'").collect());
+        assertEquals(String.format("[+I[%s]]", classPath), result.toString());
+
+        // test hive conf variable for substitution
+        result =
+                CollectionUtil.iteratorToList(
+                        tableEnv.executeSql("select 
'${hiveconf:common-key}'").collect());

Review Comment:
   Currently, we have no way to dynamically set hiveconf variables in the flink 
table api.  AFAK, hive only supports set hiveconf variables in cli or init a 
hive session with hiveconf variables. 



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