Ниже приведен пример для BigQuery Standard SQL
#standardSQL
WITH `project.dataset.questions` AS (
SELECT 1 id, "What web browser do you prefer?" title UNION ALL
SELECT 2, "Do you have gray hairs?" UNION ALL
SELECT 3, "Which is your fav Mango or apple?" UNION ALL
SELECT 4, "How to write a BIGQuery query to get a list of some words and check if they contain in another String?" UNION ALL
SELECT 5, "Is there any free way to search github that isn't severely limited and simple (aka: searching for special characters or using regex)?" UNION ALL
SELECT 6, "Is there any way to run a portion of a large query on bigquery when the free quota doesn't allow it?" UNION ALL
SELECT 7, "How to unpivot in BigQuery?" UNION ALL
SELECT 8, "how get rows with latest date?" UNION ALL
SELECT 9, "Have you heard of weblogic?"
), `project.dataset.words` AS (
SELECT 'Mango' word UNION ALL
SELECT 'Tire' UNION ALL
SELECT 'web' UNION ALL
SELECT 'gray' UNION ALL
SELECT 'Apple' UNION ALL
SELECT 'BigQuery'
)
SELECT DISTINCT q.id, q.title
FROM `project.dataset.questions` q
JOIN `project.dataset.words`
ON REGEXP_CONTAINS(LOWER(q.title), r'\b' || LOWER(word) || r'\b')
LIMIT 50
с выводом
Row id title
1 1 What web browser do you prefer?
2 2 Do you have gray hairs?
3 3 Which is your fav Mango or apple?
4 4 How to write a BIGQuery query to get a list of some words and check if they contain in another String?
5 6 Is there any way to run a portion of a large query on bigquery when the free quota doesn't allow it?
6 7 How to unpivot in BigQuery?
Чтобы запустить его против ваших собственных данных - просто удалите TCE (операторы WITH) и используйте свой реальный ссылки на таблицы