Skip to content
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

Consistent field sequence of EXAMPLES in GUIDE #79

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions bigquery/GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ WITH Examples AS (
)
SELECT
id,
TO_JSON_STRING((SELECT AS STRUCT * EXCEPT(id) FROM UNNEST([I]))) AS properties,
E.title,
E.description,
TO_JSON_STRING((SELECT AS STRUCT * EXCEPT(id) FROM UNNEST([I]))) AS properties
E.description
FROM Examples AS E
INNER JOIN `[👉DATASET]`.InputProcessing AS I USING (id);
```
Expand All @@ -118,8 +118,10 @@ You can pick some already well-performing examples from the source feed as follo
```sql
CREATE OR REPLACE TABLE `[👉DATASET]`.Examples AS
SELECT
id, title, description,
id,
TO_JSON_STRING((SELECT AS STRUCT * EXCEPT(id) FROM UNNEST([I]))) AS properties
title,
description
FROM `[👉DATASET]`.InputProcessing AS I
WHERE id IN ('👉1234567', '👉2345678')
```
Expand All @@ -131,9 +133,11 @@ Of course, the well-performing products may not even be present in `InputProcess
```sql
CREATE OR REPLACE TABLE `[👉DATASET]`.Examples AS
SELECT
id, title, description,
id,
TO_JSON_STRING(STRUCT(
`👉title`, `👉description`, `👉specifications` AS `👉specs`, `👉...`)) AS properties
`👉title`, `👉description`, `👉specifications` AS `👉specs`, `👉...`)) AS properties,
title
description
FROM `[👉DATASET]`.InputRaw
ORDER BY `👉clicks` DESC
LIMIT 3;
Expand Down