[ https://issues.apache.org/jira/browse/FLINK-4260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15639115#comment-15639115 ]
ASF GitHub Bot commented on FLINK-4260: --------------------------------------- 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. > Allow SQL's LIKE ESCAPE > ----------------------- > > Key: FLINK-4260 > URL: https://issues.apache.org/jira/browse/FLINK-4260 > Project: Flink > Issue Type: Improvement > Components: Table API & SQL > Affects Versions: 1.1.0 > Reporter: Timo Walther > Assignee: Leo Deng > Priority: Minor > > Currently, the SQL API does not support specifying an ESCAPE character in a > LIKE expression. The SIMILAR TO should also support that. -- This message was sent by Atlassian JIRA (v6.3.4#6332)