[ https://issues.apache.org/jira/browse/FLINK-16113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17083065#comment-17083065 ]
Benchao Li commented on FLINK-16113: ------------------------------------ [~jark] this bug also affects 1.9 branch, do we need to also fix that? > ExpressionReducer shouldn't escape the reduced string value > ----------------------------------------------------------- > > Key: FLINK-16113 > URL: https://issues.apache.org/jira/browse/FLINK-16113 > Project: Flink > Issue Type: Bug > Components: Table SQL / Planner > Affects Versions: 1.10.0 > Reporter: Jark Wu > Assignee: Jark Wu > Priority: Critical > Labels: pull-request-available > Fix For: 1.10.1, 1.11.0 > > Time Spent: 20m > Remaining Estimate: 0h > > ExpressionReducer shouldn't escape the reduced string value, the escaping > should only happen in code generation, otherwise the output result is > inccorect. > The problem is this line I guess: > https://github.com/apache/flink/blob/master/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/ExpressionReducer.scala#L142 > Here is a simple example to reproduce the problem: > {code:java} > val smallTupleData3: Seq[(Int, Long, String)] = { > val data = new mutable.MutableList[(Int, Long, String)] > data.+=((1, 1L, "你好")) > data.+=((2, 2L, "你好")) > data.+=((3, 2L, "你好世界")) > data > } > @Test > def test(): Unit = { > val t = env.fromCollection(smallTupleData3) > .toTable(tEnv, 'a, 'b, 'c) > tEnv.createTemporaryView("MyTable", t) > val sqlQuery = s"select * from MyTable where c = '你好'" > val result = tEnv.sqlQuery(sqlQuery).toAppendStream[Row] > val sink = new TestingAppendSink > result.addSink(sink) > env.execute() > println(sink.getAppendResults.mkString("\n")) > } > {code} > The output: > {code:java} > 1,1,\u4F60\u597D > 2,2,\u4F60\u597D > {code} > This is also mentioned in user mailing list: > http://apache-flink.147419.n8.nabble.com/ParquetTableSource-blink-table-planner-tp1696p1720.html -- This message was sent by Atlassian Jira (v8.3.4#803005)