Github user wuchong commented on a diff in the pull request: https://github.com/apache/flink/pull/2758#discussion_r86661449 --- Diff: flink-libraries/flink-table/src/test/java/org/apache/flink/api/java/batch/sql/SqlITCase.java --- @@ -118,4 +119,39 @@ public void testJoin() throws Exception { String expected = "Hi,Hallo\n" + "Hello,Hallo Welt\n" + "Hello world,Hallo Welt\n"; compareResultAsText(results, expected); } + + + @Test + public void testLikeWithEscapeFromDataSet() throws Exception { + ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); + BatchTableEnvironment tableEnv = TableEnvironment.getTableEnvironment(env, config()); + + DataSet<Tuple1<String>> ds = CollectionDataSets.getTupleDateSet(env); + tableEnv.registerDataSet("DataSetTable", ds, "x"); + + String sqlQuery = "SELECT x FROM DataSetTable WHERE x LIKE '&%%' ESCAPE '&'"; + Table result = tableEnv.sql(sqlQuery); + + DataSet<Row> resultSet = tableEnv.toDataSet(result, Row.class); + List<Row> results = resultSet.collect(); + String expected = "%leo*\n" + "%deng*\n" + "%hello*\n";; + compareResultAsText(results, expected); + } + + @Test + public void testSimilarWithEscapeFromDataSet() throws Exception { --- End diff -- remove this too.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---