-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Escaping single quotes for BigQuery SQL target #5099
Comments
There seems to be a problem with the handling of strings enclosed in single quotes, regardless of the target. from foo
select {
a = "a'b",
b = "a\"b",
c = 'a\'b',
d = "a'b",
e = 'a"b',
} SELECT
'a''b' AS a,
'a"b' AS b,
'a''b' AS c,
'a''b' AS d,
'a"b' AS e
FROM
foo
-- Generated by PRQL compiler version:0.13.2 (https://prql-lang.org)
|
@eitsupi I think the quoting behavior you posted is correct for many dialects of SQL -- a pair of single quotes I looked into this issue briefly, and PRQL uses the Rust sqlparser library to generate its SQL output, by building an AST and then using |
Thank you for pointing that out! My bad. The datafusion folks are helpful and it would be worthwhile to create an issue there. |
Hi! I also noticed this issue while working on apache/datafusion-sqlparser-rs#1679 That PR doesn't fix this issue but I'm going to work on it next. |
Thank you so much @graup |
What happened?
Bigquery escapes single quotes with a backslash
\
but prql outputs two single quotes''
.Otherwise it seems highly compatible with bigquery except for this one small thing.
PRQL input
SQL output
Expected SQL output
MVCE confirmation
Anything else?
No response
The text was updated successfully, but these errors were encountered: