You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2020/09/11 07:27:00 UTC

[jira] [Created] (CALCITE-4247) When parsing SQL in BigQuery dialect, character literals may be enclosed in single- or double-quotes, and use backslashes as escapes

Julian Hyde created CALCITE-4247:
------------------------------------

             Summary: When parsing SQL in BigQuery dialect, character literals may be enclosed in single- or double-quotes, and use backslashes as escapes
                 Key: CALCITE-4247
                 URL: https://issues.apache.org/jira/browse/CALCITE-4247
             Project: Calcite
          Issue Type: Bug
            Reporter: Julian Hyde


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:
{noformat}
'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 */
{noformat}

To control this feature, we add
{code}
enum CharLiteralStyle { STANDARD, BQ_SINGLE, BQ_DOUBLE }
{code}
and to {{interface SqlParser.Config}} we add method {{Set<CharLiteralStyle> charLiteralStyles()}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)