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

luoyuxia updated FLINK-29651:
-----------------------------
    Description: 
Can be reproduced with the following code in Flink 1.15:

 
{code:java}
// testTable contains a column `field1`
tableEnvironment
        .executeSql(
                "select *, '1' as run from testTable WHERE field1 LIKE 
'b\"cd\"e%'")
        .print(); {code}
The exception the code generated fail to compile for it will contain the 
following code line

 

 
{code:java}
private final org.apache.flink.table.data.binary.BinaryStringData str$6 = 
org.apache.flink.table.data.binary.BinaryStringData.fromString("b"cd"e");  //  
mismatched input 'cd' expecting ')'{code}
Seem it's produced by this [pr]([https://github.com/apache/flink/pull/19001]) 
which changes the logic for generate literal.

 

> Code gen will  fail when the literal specified in user's sql hasn't be 
> escaped 
> -------------------------------------------------------------------------------
>
>                 Key: FLINK-29651
>                 URL: https://issues.apache.org/jira/browse/FLINK-29651
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Runtime
>    Affects Versions: 1.15.0
>            Reporter: luoyuxia
>            Priority: Major
>
> Can be reproduced with the following code in Flink 1.15:
>  
> {code:java}
> // testTable contains a column `field1`
> tableEnvironment
>         .executeSql(
>                 "select *, '1' as run from testTable WHERE field1 LIKE 
> 'b\"cd\"e%'")
>         .print(); {code}
> The exception the code generated fail to compile for it will contain the 
> following code line
>  
>  
> {code:java}
> private final org.apache.flink.table.data.binary.BinaryStringData str$6 = 
> org.apache.flink.table.data.binary.BinaryStringData.fromString("b"cd"e");  // 
>  mismatched input 'cd' expecting ')'{code}
> Seem it's produced by this [pr]([https://github.com/apache/flink/pull/19001]) 
> which changes the logic for generate literal.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to