fsk119 commented on a change in pull request #15087:
URL: https://github.com/apache/flink/pull/15087#discussion_r588056271



##########
File path: 
flink-table/flink-sql-parser-hive/src/main/codegen/includes/parserImpls.ftl
##########
@@ -1581,3 +1581,23 @@ SqlUseModules SqlUseModules() :
         return new SqlUseModules(s.end(this), moduleNames);
     }
 }
+
+/**
+* Parses a show modules statement.

Review comment:
       "Parses" -> "Parse"

##########
File path: 
flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl
##########
@@ -1502,3 +1502,23 @@ SqlUseModules SqlUseModules() :
         return new SqlUseModules(s.end(this), moduleNames);
     }
 }
+
+/**
+* Parses a show modules statement.

Review comment:
       Ditto

##########
File path: 
flink-table/flink-sql-client/src/test/java/org/apache/flink/table/client/gateway/local/LocalExecutorITCase.java
##########
@@ -1812,6 +1812,71 @@ public void 
testHiveBuiltInFunctionWithoutUsingHiveModule() throws Exception {
                                 "select substring_index('www.apache.org', '.', 
2) from TableNumber1"));
     }
 
+    @Test
+    public void testShowModules() throws Exception {

Review comment:
       Ditto

##########
File path: 
flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/api/TableEnvironmentTest.scala
##########
@@ -644,6 +645,72 @@ class TableEnvironmentTest {
     tableEnv.executeSql("USE MODULES core, core")
   }
 
+  @Test
+  def testExecuteSqlWithShowModules(): Unit = {

Review comment:
       I think core here is a little duplicate here. What about introduce a 
helper method?
   
   ```
     def validateModules(
           showModules: String,
           showFullModules: String,
           expectedModules: Iterator[String],
           expectedFullModules: Iterator[String]): Unit = {
       val modules = tableEnv.executeSql(showModules)
       assertEquals(ResultKind.SUCCESS_WITH_CONTENT, modules.getResultKind)
       checkData(expectedModules, modules.collect())
   
       val fullModules = tableEnv.executeSql(showFullModules)
       assertEquals(ResultKind.SUCCESS_WITH_CONTENT, fullModules.getResultKind)
       checkData(expectedFullModules,
         fullModules.collect())
     }
   ```
   
   In this way, we can also beautify the variable names.




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


Reply via email to