Samin061 opened a new pull request, #5094:
URL: https://github.com/apache/calcite/pull/5094

   ## Jira Link
   
   No Jira filed yet; happy to open one if preferred. This is a small escaping 
fix in the SQL generator.
   
   ## Changes Proposed
   
   `BigQuerySqlDialect` declares its escaped quote as `\'`, but the base 
`quoteStringLiteral` only replaces the quote character, so a literal backslash 
in a string value reaches BigQuery unescaped. BigQuery treats backslash as an 
escape character inside string literals, so a pushed-down value such as `x\` or 
`\'; ...` closes the literal early and the trailing characters are parsed as 
SQL rather than data. Override `quoteStringLiteral` to double backslashes 
before the base method escapes the enclosing quote, so backslash-containing 
values round-trip as data. Added a rel2sql regression test next to 
`testCharLiteralForBigQuery`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to