question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bigquery SQL Engine Cannot Handle Strings with Apostrophe

See original GitHub issue

When 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:closed
  • Created 2 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
villebrocommented, Aug 21, 2021

Btw, I just tested this with Sqlite, and it works as expected: image

So this should really be handled in the dialect as @john-bodley suggested.

1reaction
jamesrayoubcommented, Aug 20, 2021
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found