Sophie Sepp
Sophie Sepp

Reputation: 551

Searching UTF8 special characters with a query using Google Bigquery

I have a query that is supposed to find the occurence of a special character in UTF8.

That is my query:

SELECT key FROM workspace.table1 WHERE key CONTAINS '\u266D'

However, I get the error message "Invalid string literal".

How can I properly use UTF8 characters in my query?

Upvotes: 2

Views: 2437

Answers (1)

Jordan Tigani
Jordan Tigani

Reputation: 26617

BigQuery accepts UTF8 encoded input, so you should be able to pass the utf character in your query directly, rather than using the hex code:

SELECT count(*) from publicdata:samples.wikipedia where
title contains '♭'

returns 651

Upvotes: 1

Related Questions