Skip to content

Add BigQuery -> ClickHouse SQL reference#6224

Open
Blargian wants to merge 7 commits into
ClickHouse:mainfrom
Blargian:bigquery-sql-reference
Open

Add BigQuery -> ClickHouse SQL reference#6224
Blargian wants to merge 7 commits into
ClickHouse:mainfrom
Blargian:bigquery-sql-reference

Conversation

@Blargian

@Blargian Blargian commented May 14, 2026

Copy link
Copy Markdown
Member

Summary

Adds a BigQuery to ClickHouse SQL reference guide

Checklist


Note

Low Risk
Documentation and CSS only; no application code, auth, or data paths.

Overview
Adds a dedicated BigQuery SQL translation reference at /migrations/bigquery/sql-translation-reference with side-by-side BigQuery vs ClickHouse mappings for types, DDL/DML/DCL, query syntax, operators, and function families (arrays, aggregates, windows, dates, strings, JSON).

The BigQuery vs ClickHouse Cloud overview no longer embeds the full type table and long array/UNNEST examples; those sections now point to the reference. The BigQuery migration landing page lists the new doc, and custom.scss introduces .sql-translation-table styling for the comparison tables (including a three-column notes variant).

Reviewed by Cursor Bugbot for commit 56e5806. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented May 14, 2026

Copy link
Copy Markdown

@Blargian is attempting to deploy a commit to the ClickHouse Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented May 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clickhouse-docs Ready Ready Preview May 15, 2026 3:50pm

Request Review

@dhtclk dhtclk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few comments (mostly British spellings)

Comment thread docs/cloud/onboard/02_migrate/01_migration_guides/03_bigquery/index.md Outdated
Co-authored-by: Dominic Tran <dominic.tran@clickhouse.com>
Comment thread docs/cloud/onboard/02_migrate/01_migration_guides/03_bigquery/index.md Outdated
Comment thread docs/cloud/onboard/02_migrate/01_migration_guides/03_bigquery/index.md Outdated
Blargian added 3 commits May 14, 2026 18:20
Co-authored-by: Shaun Struwig <41984034+Blargian@users.noreply.github.com>
…e table notes to make it more clear they belong to the row above
| [`JSON`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#json_type) | [`JSON`](/sql-reference/data-types/newjson) &nbsp;or&nbsp; [`String`](/sql-reference/data-types/string) | `JSON` is preferred; `String` with [`JSONExtract*`](/sql-reference/functions/json-functions) accessors works as a fallback |
| [`NUMERIC`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#decimal_types) | [`Decimal(P, S)`](/sql-reference/data-types/decimal) | Sized variants `Decimal32(S)` / `Decimal64(S)` / `Decimal128(S)` are also available |
| [`RANGE`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#range_type) | No equivalent | Store `(start, end)` columns or a `Tuple(start, end)` |
| [`STRING`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#string_type) | [`String`](/sql-reference/data-types/string) | Optionally wrap in [`LowCardinality(String)`](/sql-reference/data-types/lowcardinality) for columns with few distinct values (enums, status codes, country codes). String functions are byte-based; the [String family](/sql-reference/functions/string-functions) has `UTF8` variants where relevant |

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feedback from Amy: We should probably flag this as a performance optimization. This might be because I'm in dark mode but I didn't realize those data types were actually links.

<tr>
<td colSpan={2}>

Location is a service-level decision in ClickHouse Cloud.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feedback from Amy: decision? maybe configuration?


## DDL statements {#ddl-statements}

### Schemas and databases {#ddl-schemas}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feedback from Amy: missing the three part namespace callout

<tr>
<td colSpan={2}>

An engine and an `ORDER BY` are required for `MergeTree`-family tables; pick the columns that match the query access pattern. See [Sparse primary indexes](/guides/best-practices/sparse-primary-indexes).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feedback from Amy: I think we need a sentence as to why order by is so crucial in clickhouse. it would make the partition comment make more sense. Also link out to what even is a mergetree

</tbody>
</table>

### Roles {#dcl-roles}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feedback from Amy: I think this table is unnecessary - I think you could just do a sentence and link to the create role/user docs

</tbody>
</table>

### Pipe syntax {#pipe-syntax}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feedback from Amy: you could just say we don't support this?

@Blargian Blargian marked this pull request as draft May 27, 2026 18:30
@Blargian Blargian marked this pull request as ready for review June 1, 2026 12:37
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants