CHLambda created FLINK-34385:
--------------------------------

             Summary: When using table api to operate a jdbc table whose name 
is a keyword, exceptions like "You have an error in your SQL syntax..." will be 
reported.
                 Key: FLINK-34385
                 URL: https://issues.apache.org/jira/browse/FLINK-34385
             Project: Flink
          Issue Type: Bug
          Components: Connectors / JDBC
    Affects Versions: 1.18.1
            Reporter: CHLambda


For instance, I created a table named 'table', and when executing 
{{{}tableEnvironment.from("table"){}}}, it results in an error message that 
reads: "You have an error in your SQL syntax; please consult the manual for the 
correct syntax to use near 'table' at line 1 corresponding to your MySQL server 
version." Even if I enclose the table name with backticks, the error continues 
to occur because these backticks are stripped within the flink-sql-parser's 
code.

In FLINK-16067 issue, there is a suggestion stating: "I propose making the 
parsing logic for identifiers in the Table API more flexible. We should not 
force users to escape any SQL identifiers." This explains why backticks are 
removed by the flink-sql-parser. However, this aspect seems to be overlooked in 
the JDBC connector's code.

If indeed this is a genuine issue, I would be more than happy to submit a Pull 
Request to fix it. Please assign it to me.

 



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

Reply via email to