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

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

Jark Wu created FLINK-16113:
-------------------------------

             Summary: 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
            Reporter: Jark Wu
            Assignee: Jark Wu
             Fix For: 1.10.1


ExpressionReducer shouldn't escape the reduced string value, the escaping should only happen in code generation, otherwise the output result is inccorect. 

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)