Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-34385

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.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.18.1
    • None
    • Connectors / JDBC
    • None

    Description

      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 flink-connector-jdbc'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.

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            chlambda CHLambda
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: