Bigquery SQL Engine Cannot Handle Strings with Apostrophe
See original GitHub issueWhen filtering on a string dimension which contains an apostrophe (i.e. family name - O’Brien), the sql engine generates a WHERE
statement which uses single quotes instead of double quotes which leads to:
400 Syntax error: Parenthesized expression cannot be parsed as an expression, struct constructor, or subquery
Expected results
WHERE project_name IN ("Beverly O'Brien")
Actual results
WHERE project_name IN ('Beverly O''Brien')
Notes
Using a BigQuery database connection
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Lexical structure and syntax | BigQuery - Google Cloud
Cannot be empty. Have the same escape sequences as string literals. If an identifier is the same as a reserved keyword, the identifier...
Read more >Bug: Apostrophes in text field breaks the query #8708 - GitHub
I am using: Browser: Chrome 68.1. Operating system: OS Databases: BigQuery. Metabase version: 0.30.2. Metabase hosting environment: Google ...
Read more >sql - Searching for a value with apostrophe (') using ...
I am trying to search for a specific list of surnames from a table. DECLARE X ARRAY<STRING>; SET X = {'ALI' ...
Read more >BigQuery Regex and Pattern Matching: 6 Major Things
6 BigQuery Regex Functions. As BigQuery uses SQL at the backend, it allows users to match, search and replace or validate a string...
Read more >Inserting a string that contains an embedded apostrophe into ...
System Reported Fixed* Reported Fixed*
Microsoft® Windows® for x64 9.4 9.41 9.4 TS1M6 9.4 TS1M7
Microsoft Windows 8 Enterprise 32‑bit 9.4 9.41 9.4 TS1M6 9.4...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Btw, I just tested this with Sqlite, and it works as expected:
So this should really be handled in the dialect as @john-bodley suggested.
@junlincc @daniel10012