[ 
https://issues.apache.org/jira/browse/FLINK-15223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16995446#comment-16995446
 ] 

Jingsong Lee commented on FLINK-15223:
--------------------------------------

I think this bug is not easy to fix in 1.10, we can let it in 1.11.

Like tEnv.sqlQuery,  the text of tEnv.sqlUpdate should not be unescaped. From 
Java coder side, we should keep origin text like calcite.

> It's safe to unescape "\n" written in Java, the result is still line break 
>character.

It is not safe, if user really want to "\n" instead of line break, We need a 
clear definition.

> Flink SQL parser accepts a SQL text, it may comes from Java, also can come 
>from files. For example, reading from an existing file and call 
>{{tEnv.sqlUpdate(text)}}. This is very possible for platform users who build 
>SQL platform based on {{TableEnvironment}}.

So, please do unescape by SQL platform user themselves, we do not need to do 
these unnecessary things. 

> It's tricky and error-prone to fix in SQL-CLI side. How to do it? Are you 
>planning to unescape the whole SQL? It may affect queries.

I don't know, let's learn and get more informations.

> Csv connector should unescape delimiter parameter characters
> ------------------------------------------------------------
>
>                 Key: FLINK-15223
>                 URL: https://issues.apache.org/jira/browse/FLINK-15223
>             Project: Flink
>          Issue Type: Bug
>          Components: Formats (JSON, Avro, Parquet, ORC, SequenceFile)
>            Reporter: Jark Wu
>            Assignee: Jingsong Lee
>            Priority: Blocker
>             Fix For: 1.10.0
>
>
> As described in documentation[1], a csv format can use 
> {{'format.line-delimiter' = '\n'}} to specify line delimiter. However, the 
> property value is parsed into two characters "\n" , this result to reading 
> failed. There is no workaround for now, unless fix it. The delimiter should 
> be unescaped, e.g. using {{StringEscapeUtils.unescapeJava}}. Note that both 
> old csv and new csv have the same problem, and both {{field-delimiter}} and 
> {{line-delimiter}}.
> [1]: 
> https://ci.apache.org/projects/flink/flink-docs-master/dev/table/connect.html#old-csv-format



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to