You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Jark Wu (Jira)" <ji...@apache.org> on 2020/04/19 11:38:00 UTC

[jira] [Updated] (FLINK-16113) ExpressionReducer shouldn't escape the reduced string value

     [ https://issues.apache.org/jira/browse/FLINK-16113?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jark Wu updated FLINK-16113:
----------------------------
    Fix Version/s: 1.9.4

> 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, 1.9.4
>
>          Time Spent: 40m
>  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)