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

When parsing SQL in BigQuery dialect, character literals may be enclosed in single- or double-quotes, and use backslashes as escapes

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.26.0
    • babel
    • None

    Description

      When parsing SQL in BigQuery dialect, character literals may be enclosed in single- or double-quotes, and use backslashes as escapes. In standard SQL, and most dialects, character literals are enclosed in single-quotes only, and use single-quotes as the escape character.

      For example:

      'Let''s call him "Elvis"!' /* valid in Oracle, PostgreSQL, etc. */
      'Let\'s call him "Elvis"!' /* valid in BigQuery */
      "Let's call him \"Elvis\"!" /* valid in BigQuery */
      

      To control this feature, we add

      enum CharLiteralStyle { STANDARD, BQ_SINGLE, BQ_DOUBLE }
      

      and to interface SqlParser.Config we add method Set<CharLiteralStyle> charLiteralStyles().

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment