Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4847

Parse SQL with BigQuery-style quoted identifiers and character literals

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.28.0
    • None
    • None

    Description

      Parse SQL with BigQuery-style quoted identifiers and character literals.

      BigQuery quotes identifiers using backticks, escaping interior backticks using backslash. In CALCITE-4767 we added Quoting.BACK_TICK_BACKSLASH to distinguish this style from what MySQL does, namely Quoting.BACK_TICK.

      BigQuery quotes character literals using double quotes, escaping interior double quotes using backslash. In CALCITE-4767 we added Quoting.DOUBLE_QUOTE_BACKSLASH to distinguish this style from Quoting.DOUBLE_QUOTE.

      After this change, we should be able to parse the following query if we invoke the parser with lex=BIG_QUERY or dialect=BIG_QUERY:

      SELECT "a \"quoted\" char literal"
      FROM `a \`quoted\` table`
      

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              julianhyde Julian Hyde
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: