aljoscha commented on a change in pull request #11986:
URL: https://github.com/apache/flink/pull/11986#discussion_r421464138



##########
File path: 
flink-connectors/flink-jdbc/src/test/java/org/apache/flink/api/java/io/jdbc/JDBCTableSourceITCase.java
##########
@@ -153,4 +153,34 @@ public void testProjectableJDBCSource() throws Exception {
                                "2020-01-01T15:36:01.123456,101.1234");
                StreamITCase.compareWithList(expected);
        }
+
+       @Test
+       public void testScanQueryJDBCSource() throws Exception {
+               StreamExecutionEnvironment env = 
StreamExecutionEnvironment.getExecutionEnvironment();
+               EnvironmentSettings envSettings = 
EnvironmentSettings.newInstance()
+                       .useBlinkPlanner()
+                       .inStreamingMode()
+                       .build();
+               StreamTableEnvironment tEnv = 
StreamTableEnvironment.create(env, envSettings);
+
+               final String testQuery = "SELECT id FROM " + INPUT_TABLE;
+               tEnv.sqlUpdate(
+                       "CREATE TABLE test(" +
+                               "id BIGINT" +
+                               ") WITH (" +
+                               "  'connector.type'='jdbc'," +
+                               "  'connector.url'='" + DB_URL + "'," +
+                               "  'connector.table'='whatever'," +
+                               "  'connector.read.query'='" + testQuery + "'" +
+                               ")"
+               );
+
+               StreamITCase.clear();

Review comment:
       I understand, the code code that is there is already not good. 😞




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to