id stringlengths 36 36 | document stringlengths 3 3k | metadata stringlengths 23 69 | embeddings listlengths 384 384 |
|---|---|---|---|
0fd5d3da-cb45-4ace-8b31-010bde22deba | :::info
If you'd like to only perform a one-time load of your data (
Initial Load Only
), please skip steps 2 onward.
:::
Create a Postgres user for the pipe and grant it permissions to
SELECT
the tables you wish to replicate.
sql
CREATE USER clickpipes_user PASSWORD 'clickpipes_password';
GRANT USAGE ON ... | {"source_file": "timescale.md"} | [
0.04183976352214813,
-0.07861729711294174,
-0.06912253797054291,
0.001742762979120016,
-0.12620408833026886,
-0.022980129346251488,
0.01209074817597866,
-0.019236193969845772,
-0.07115473598241806,
0.05474397912621498,
-0.025275882333517075,
-0.09899386763572693,
0.013764080591499805,
-0.0... |
36d70c1c-5d69-43f8-9511-9fd79b2c201f | sidebar_label: 'Crunchy Bridge Postgres'
description: 'Set up Crunchy Bridge Postgres as a source for ClickPipes'
slug: /integrations/clickpipes/postgres/source/crunchy-postgres
title: 'Crunchy Bridge Postgres Source Setup Guide'
keywords: ['crunchy bridge', 'postgres', 'clickpipes', 'logical replication', 'data ingest... | {"source_file": "crunchy-postgres.md"} | [
-0.016635829582810402,
-0.005774525925517082,
-0.08196104317903519,
0.014262145385146141,
-0.037336356937885284,
-0.09204836934804916,
-0.007007095031440258,
0.045967474579811096,
-0.08039411902427673,
-0.030855542048811913,
-0.014783996157348156,
-0.0188433974981308,
0.033051714301109314,
... |
6a978758-a877-44cd-8336-b83de4f138bd | sidebar_label: 'Planetscale for Postgres'
description: 'Set up Planetscale for Postgres as a source for ClickPipes'
slug: /integrations/clickpipes/postgres/source/planetscale
title: 'PlanetScale for Postgres Source Setup Guide'
doc_type: 'guide'
keywords: ['clickpipes', 'postgresql', 'cdc', 'data ingestion', 'real-time... | {"source_file": "planetscale.md"} | [
0.06421693414449692,
0.03674568608403206,
-0.014069648459553719,
0.025812741369009018,
0.012304732576012611,
-0.05073457956314087,
0.01948358491063118,
0.07183737307786942,
-0.02732977271080017,
0.032544512301683426,
-0.023229336366057396,
-0.029628152027726173,
0.02712993696331978,
-0.069... |
5f04dc8e-6563-42de-9e63-d98aa6c207f0 | ``
:::note
Make sure to replace
clickpipes_user
and
clickpipes_password` with your desired username and password.
:::
Caveats {#caveats}
To connect to PlanetScale Postgres, the current branch needs to be appended to the username created above. For example, if the created user was named
clickpipes_user
, the actu... | {"source_file": "planetscale.md"} | [
-0.00725737027823925,
-0.04226567968726158,
-0.0831858366727829,
-0.07711201906204224,
-0.11859395354986191,
-0.036080654710531235,
0.02130015939474106,
0.06141148880124092,
0.01296504307538271,
0.03222070634365082,
-0.04410049691796303,
-0.047523532062768936,
-0.02119429036974907,
-0.0358... |
0b39653e-194e-4ed1-aac0-4baadcfbb08d | sidebar_label: 'Azure Flexible Server for Postgres'
description: 'Set up Azure Flexible Server for Postgres as a source for ClickPipes'
slug: /integrations/clickpipes/postgres/source/azure-flexible-server-postgres
title: 'Azure Flexible Server for Postgres Source Setup Guide'
keywords: ['azure', 'flexible server', 'pos... | {"source_file": "azure-flexible-server-postgres.md"} | [
-0.01250460185110569,
-0.018152931705117226,
-0.08284691721200943,
0.027503537014126778,
-0.0551910400390625,
-0.013128858990967274,
0.041031233966350555,
0.022136155515909195,
-0.067954882979393,
0.0005494867800734937,
0.019246263429522514,
0.00879162922501564,
0.008145000785589218,
-0.04... |
69c28b21-9f53-4391-9e2c-15223488d61a | Add ClickPipes IPs to Firewall {#add-clickpipes-ips-to-firewall}
Please follow the below steps to add
ClickPipes IPs
to your network.
Go to the
Networking
tab and add the
ClickPipes IPs
to the Firewall
of your Azure Flexible Server Postgres OR the Jump Server/Bastion if you are using SSH tunneling.
... | {"source_file": "azure-flexible-server-postgres.md"} | [
0.04492095857858658,
-0.026997016742825508,
-0.06623919308185577,
-0.038290057331323624,
-0.07270260155200958,
0.041237059980630875,
0.02775508537888527,
-0.061448849737644196,
-0.008848643861711025,
0.06436296552419662,
0.001925583346746862,
-0.00043783726869150996,
-0.0044991569593548775,
... |
d04c17fe-cba1-4d07-bd34-af9a78c0e027 | sidebar_label: 'Neon Postgres'
description: 'Set up Neon Postgres instance as a source for ClickPipes'
slug: /integrations/clickpipes/postgres/source/neon-postgres
title: 'Neon Postgres Source Setup Guide'
doc_type: 'guide'
keywords: ['clickpipes', 'postgresql', 'cdc', 'data ingestion', 'real-time sync']
import neo... | {"source_file": "neon-postgres.md"} | [
-0.06731948256492615,
-0.003242001635953784,
-0.09401977807283401,
0.01362677849829197,
-0.019352471455931664,
-0.017429035156965256,
-0.010715479962527752,
-0.004405655898153782,
-0.06489337980747223,
-0.04862707853317261,
0.055784232914447784,
-0.029261112213134766,
-0.04294724762439728,
... |
0d0d6ab6-7f7c-4f97-b379-2cde672eb286 | IP whitelisting (for Neon enterprise plan) {#ip-whitelisting-for-neon-enterprise-plan}
If you have Neon Enterprise plan, you can whitelist the
ClickPipes IPs
to allow replication from ClickPipes to your Neon Postgres instance.
To do this you can click on the
Settings
tab and go to the
IP Allow
section.
Copy... | {"source_file": "neon-postgres.md"} | [
-0.019455280154943466,
0.022824153304100037,
-0.05059142783284187,
-0.062445126473903656,
-0.06270851939916611,
-0.0023464399855583906,
-0.007240666542202234,
-0.0668555274605751,
-0.04610113799571991,
-0.0008349188137799501,
-0.018053509294986725,
0.02098502218723297,
-0.030809177085757256,... |
2d922e7a-8494-47c1-abb3-87d581deb1d9 | sidebar_label: 'Google Cloud SQL'
description: 'Set up Google Cloud SQL Postgres instance as a source for ClickPipes'
slug: /integrations/clickpipes/postgres/source/google-cloudsql
title: 'Google Cloud SQL Postgres Source Setup Guide'
doc_type: 'guide'
keywords: ['google cloud sql', 'postgres', 'clickpipes', 'logical d... | {"source_file": "google-cloudsql.md"} | [
-0.01873905584216118,
-0.044704619795084,
-0.0472860150039196,
0.0024638096801936626,
-0.04348786175251007,
-0.0015895470278337598,
0.07014274597167969,
-0.043902456760406494,
-0.04138384386897087,
0.03119770437479019,
-0.012793156318366528,
-0.026620658114552498,
-0.007221279200166464,
-0... |
e4062d24-67e0-4eec-8ea9-ae3b30bf2f3f | sql
GRANT USAGE ON SCHEMA "public" TO clickpipes_user;
GRANT SELECT ON ALL TABLES IN SCHEMA "public" TO clickpipes_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA "public" GRANT SELECT ON TABLES TO clickpipes_user;
Grant replication access to this user:
sql
ALTER ROLE clickpipes_user REPLICATION;
Creat... | {"source_file": "google-cloudsql.md"} | [
0.04280292987823486,
-0.08296395093202591,
-0.08830874413251877,
-0.02689485251903534,
-0.10099337249994278,
0.00048464263090863824,
-0.006296928506344557,
-0.056365251541137695,
-0.05038556829094887,
0.08758940547704697,
-0.022110989317297935,
-0.04109564051032066,
0.038568370044231415,
-... |
35996bbc-f64e-48a9-9e8c-9d1419aeee0e | sidebar_label: 'Supabase Postgres'
description: 'Set up Supabase instance as a source for ClickPipes'
slug: /integrations/clickpipes/postgres/source/supabase
title: 'Supabase Source Setup Guide'
doc_type: 'guide'
keywords: ['clickpipes', 'postgresql', 'cdc', 'data ingestion', 'real-time sync']
import supabase_comma... | {"source_file": "supabase.md"} | [
-0.01982814446091652,
-0.025524232536554337,
-0.07218369096517563,
-0.0007604499696753919,
-0.027084870263934135,
-0.003972540609538555,
0.00864090770483017,
0.06610257923603058,
-0.05727544054389,
-0.03967412933707237,
0.03610553592443466,
-0.002437090501189232,
-0.0006241680821403861,
-0... |
5bd4516e-46d7-4327-87d3-403515e0b602 | :::info
The connection pooler is not supported for CDC based replication, hence it needs to be disabled.
:::
Note on RLS {#note-on-rls}
The ClickPipes Postgres user must not be restricted by RLS policies, as it can lead to missing data. You can disable RLS policies for the user by running the below command:
sq... | {"source_file": "supabase.md"} | [
-0.0092789800837636,
-0.09629520028829575,
-0.057010941207408905,
-0.03752129524946213,
-0.07346461713314056,
-0.015807291492819786,
0.028634976595640182,
-0.03904126212000847,
0.028524944558739662,
0.06603497266769409,
0.0020450023002922535,
-0.02958621457219124,
0.005527286324650049,
-0.... |
ab278743-0fa5-475c-82c5-e18f5299235e | sidebar_label: 'Amazon RDS Postgres'
description: 'Set up Amazon RDS Postgres as a source for ClickPipes'
slug: /integrations/clickpipes/postgres/source/rds
title: 'RDS Postgres Source Setup Guide'
doc_type: 'guide'
keywords: ['clickpipes', 'postgresql', 'cdc', 'data ingestion', 'real-time sync']
import parameter_g... | {"source_file": "rds.md"} | [
0.0014135150704532862,
-0.020170586183667183,
-0.09214801341295242,
0.021414056420326233,
-0.0079637560993433,
0.007721757981926203,
0.0000050063217713613994,
-0.018800504505634308,
-0.009593832306563854,
0.04067324474453926,
0.07921086996793747,
-0.022557754069566727,
-0.018379388377070427,... |
7d73cfdc-aa6d-48b1-93d7-e4c2548555b5 | Grant replication privileges:
sql
GRANT rds_replication TO clickpipes_user;
Create a publication for replication:
sql
CREATE PUBLICATION clickpipes_publication FOR ALL TABLES;
Configure network access {#configure-network-access}
IP-based access control {#ip-based-access-control}
If you want to restr... | {"source_file": "rds.md"} | [
-0.022678496316075325,
-0.07125777751207352,
-0.0733853206038475,
-0.011033694259822369,
-0.10687215626239777,
0.020052632316946983,
-0.004777831025421619,
-0.054015595465898514,
-0.025006376206874847,
0.11940684169530869,
-0.04322633147239685,
-0.013411242514848709,
0.09366340935230255,
0... |
d7633f19-0d58-4d6e-b481-d6d2940a6eb9 | sidebar_label: 'Generic Postgres'
description: 'Set up any Postgres instance as a source for ClickPipes'
slug: /integrations/clickpipes/postgres/source/generic
title: 'Generic Postgres Source Setup Guide'
doc_type: 'guide'
keywords: ['postgres', 'clickpipes', 'logical replication', 'pg_hba.conf', 'wal level']
Gener... | {"source_file": "generic.md"} | [
-0.019033271819353104,
-0.1332988142967224,
-0.07033319026231766,
-0.04864581674337387,
-0.09708024561405182,
-0.014377173967659473,
0.002434720518067479,
-0.03402785211801529,
-0.05917596444487572,
0.028059428557753563,
0.004695272073149681,
0.05190901458263397,
-0.002044449094682932,
-0.... |
07925595-9f81-473e-a499-228f3b50f42c | Make necessary changes to the
pg_hba.conf
file to allow connections to the ClickPipes user from the ClickPipes IP addresses. An example entry in the
pg_hba.conf
file would look like:
response
host all clickpipes_user 0.0.0.0/0 scram-sha-256
Reload the PostgreSQL instance for the cha... | {"source_file": "generic.md"} | [
0.019174499437212944,
-0.07285158336162567,
-0.02591046504676342,
-0.015171104110777378,
-0.10505404323339462,
-0.008492077700793743,
-0.0026149728801101446,
-0.06583895534276962,
-0.05978311598300934,
0.04194088652729988,
-0.03607805818319321,
0.08810747414827347,
-0.023744046688079834,
-... |
1478dc3b-21d7-47f0-a5f5-29bf91ba407a | sidebar_label: 'Amazon Aurora MySQL'
description: 'Step-by-step guide on how to set up Amazon Aurora MySQL as a source for ClickPipes'
slug: /integrations/clickpipes/mysql/source/aurora
title: 'Aurora MySQL source setup guide'
doc_type: 'guide'
keywords: ['aurora mysql', 'clickpipes', 'binlog retention', 'gtid mode', '... | {"source_file": "aurora.md"} | [
-0.0022366398479789495,
0.023458555340766907,
-0.11876356601715088,
0.018043609336018562,
0.007229932583868504,
-0.014070725999772549,
0.08003382384777069,
-0.00962502509355545,
-0.05672220513224602,
0.006838839966803789,
0.027636727318167686,
-0.059684980660676956,
0.12008196860551834,
-0... |
6124fb9a-2ef4-4db1-8fa1-bc12e7dc38ec | We recommend setting the
Backup retention period
to a reasonably long value, depending on the replication use case.
2. Increase the binlog retention interval {#binlog-retention-interval}
:::warning
If ClickPipes tries to resume replication and the required binlog files have been purged due to the configured binlo... | {"source_file": "aurora.md"} | [
0.008526662364602089,
-0.04099619761109352,
-0.03946616128087044,
0.010014711879193783,
-0.024634676054120064,
-0.03390578180551529,
-0.019347015768289566,
-0.061190105974674225,
-0.018954552710056305,
0.06496315449476242,
-0.0496525801718235,
0.04816620796918869,
0.08174583315849304,
0.00... |
6f7801df-5a2e-4501-8bba-7704e1acd4c3 | Set
enforce_gtid_consistency
to
ON
.
Set
gtid-mode
to
ON
.
Click on
Save Changes
in the top right corner.
Reboot your instance for the changes to take effect.
Configure a database user {#configure-database-user}
Connect to your Aurora MySQL instance as an admin user and execute the following comma... | {"source_file": "aurora.md"} | [
0.012781614437699318,
-0.06866501271724701,
-0.10931554436683655,
0.011643623933196068,
-0.10328251868486404,
-0.032257840037345886,
0.04729503393173218,
-0.07505552470684052,
-0.0567205585539341,
0.05061512812972069,
-0.07965316623449326,
-0.019907375797629356,
0.15229061245918274,
0.0014... |
a4128b3a-010d-4c67-b5f9-e2922755f16e | sidebar_label: 'Cloud SQL For MySQL '
description: 'Step-by-step guide on how to set up Cloud SQL for MySQL as a source for ClickPipes'
slug: /integrations/clickpipes/mysql/source/gcp
title: 'Cloud SQL for MySQL source setup guide'
keywords: ['google cloud sql', 'mysql', 'clickpipes', 'pitr', 'root ca certificate']
doc... | {"source_file": "gcp.md"} | [
-0.007120494265109301,
-0.04521757736802101,
-0.0014767557149752975,
-0.020679432898759842,
-0.059886060655117035,
-0.04098421707749367,
0.1055552065372467,
0.03670463711023331,
-0.06729345768690109,
0.006841720547527075,
0.03187096491456032,
-0.08422231674194336,
0.11710616946220398,
-0.0... |
f8f3a444-14a7-4d39-b06d-6c86a995bed7 | Grant replication permissions to the user:
sql
GRANT REPLICATION CLIENT ON *.* TO 'clickpipes_user'@'%';
GRANT REPLICATION SLAVE ON *.* TO 'clickpipes_user'@'%';
Configure network access {#configure-network-access-gcp-mysql}
If you want to restrict traffic to your Cloud SQL instance, please add the
documente... | {"source_file": "gcp.md"} | [
0.0038347719237208366,
-0.08197339624166489,
-0.01055699773132801,
-0.04442020133137703,
-0.11297319829463959,
0.02153833396732807,
0.08443304896354675,
-0.023193296045064926,
-0.036464251577854156,
0.07762569934129715,
-0.0419485829770565,
-0.02950352616608143,
0.1313999891281128,
0.01737... |
625200fc-046b-4acb-9c11-1dfc528c37b8 | sidebar_label: 'Amazon RDS MariaDB'
description: 'Step-by-step guide on how to set up Amazon RDS MariaDB as a source for ClickPipes'
slug: /integrations/clickpipes/mysql/source/rds_maria
title: 'RDS MariaDB source setup guide'
doc_type: 'guide'
keywords: ['clickpipes', 'mysql', 'cdc', 'data ingestion', 'real-time sync'... | {"source_file": "rds_maria.md"} | [
-0.00035758386366069317,
-0.013580786064267159,
-0.06073871999979019,
0.03653806447982788,
-0.008526955731213093,
0.05151586979627609,
0.0038116236682981253,
0.09419460594654083,
-0.03841301426291466,
0.0018907474586740136,
0.012032533064484596,
-0.05137717351317406,
0.09279131144285202,
-... |
2d2f10cb-2110-405b-8ba3-b51053b1e009 | text
mysql=> call mysql.rds_set_configuration('binlog retention hours', 24);
Configure binlog settings in the parameter group {#binlog-parameter-group-rds}
The parameter group can be found when you click on your MariaDB instance in the RDS Console, and then navigate to the
Configurations
tab.
Upon clicking on... | {"source_file": "rds_maria.md"} | [
0.09724967926740646,
-0.0096737677231431,
-0.030674852430820465,
0.05319293960928917,
-0.002298958133906126,
0.0630655586719513,
-0.005157193634659052,
0.04815319553017616,
0.017377987504005432,
0.0326819121837616,
-0.004263067152351141,
-0.011989405378699303,
0.08761154115200043,
0.064874... |
23698f1b-27bd-4894-ad0e-c8d7ce1cb747 | sidebar_label: 'Amazon RDS MySQL'
description: 'Step-by-step guide on how to set up Amazon RDS MySQL as a source for ClickPipes'
slug: /integrations/clickpipes/mysql/source/rds
title: 'RDS MySQL source setup guide'
doc_type: 'guide'
keywords: ['clickpipes', 'mysql', 'cdc', 'data ingestion', 'real-time sync']
import... | {"source_file": "rds.md"} | [
0.006780266296118498,
0.004557395353913307,
-0.09470880776643753,
0.0058081443421542645,
0.007917904295027256,
-0.014238351956009865,
0.0484439916908741,
0.020694078877568245,
-0.05666892230510712,
0.019404200837016106,
0.05912105366587639,
-0.07287726551294327,
0.12534821033477783,
-0.045... |
5c5c669f-d4f2-4293-b779-5e56000b3e64 | We recommend setting the
Backup retention period
to a reasonably long value, depending on the replication use case.
2. Increase the binlog retention interval {#binlog-retention-interval}
:::warning
If ClickPipes tries to resume replication and the required binlog files have been purged due to the configured binlo... | {"source_file": "rds.md"} | [
0.004247001372277737,
-0.05153535306453705,
-0.023760687559843063,
0.008012809790670872,
-0.006627350114285946,
-0.03516867384314537,
-0.036771755665540695,
-0.04820684343576431,
-0.017681539058685303,
0.07236355543136597,
-0.026296215131878853,
0.0416145958006382,
0.11793830245733261,
-0.... |
f6eaece3-118c-4ca3-9498-66e7f3d12210 | Set
enforce_gtid_consistency
to
ON
.
Set
gtid-mode
to
ON
.
Click on
Save Changes
in the top right corner.
Reboot your instance for the changes to take effect.
:::tip
The MySQL ClickPipe also supports replication without GTID mode. However, enabling GTID mode is recommended for better performance an... | {"source_file": "rds.md"} | [
0.00039744144305586815,
-0.11491034179925919,
-0.06063428521156311,
-0.013878908008337021,
-0.10221855342388153,
-0.03702410310506821,
-0.010881039313971996,
-0.07987817376852036,
-0.061248015612363815,
0.06730101257562637,
-0.03977659344673157,
-0.0036707434337586164,
0.17326384782791138,
... |
c87b51d5-7069-45a6-a2b0-d52beca8cc0d | sidebar_label: 'Generic MariaDB'
description: 'Set up any MariaDB instance as a source for ClickPipes'
slug: /integrations/clickpipes/mysql/source/generic_maria
title: 'Generic MariaDB source setup guide'
doc_type: 'guide'
keywords: ['generic mariadb', 'clickpipes', 'binary logging', 'ssl tls', 'self hosted']
Gener... | {"source_file": "generic_maria.md"} | [
0.03347490727901459,
-0.06944877654314041,
0.012312992475926876,
0.0339231863617897,
-0.027228577062487602,
-0.019303353503346443,
-0.020796848461031914,
0.07880891859531403,
0.02507662959396839,
-0.042340587824583054,
-0.008504035882651806,
-0.011850421316921711,
0.05762459710240364,
0.04... |
8915ef0f-1cfe-4280-b690-fe23c5816a9c | Trusted Certificate Authority (DigiCert, Let's Encrypt, etc.)
- no additional configuration needed.
Internal Certificate Authority
- Obtain the root CA certificate file from your IT team. In the ClickPipes UI, upload it when creating a new MariaDB ClickPipe.
Self-hosted MariaDB
- Copy the CA certificate from you... | {"source_file": "generic_maria.md"} | [
-0.00009947396029019728,
-0.0259802658110857,
-0.025705751031637192,
-0.004423064179718494,
-0.07425408810377121,
-0.028403399512171745,
-0.05366786941885948,
0.046908650547266006,
0.03586556389927864,
-0.057870324701070786,
-0.03740260750055313,
-0.06611187756061554,
0.08783014118671417,
... |
add0603a-ff8e-418f-a8f7-d9495bda62e8 | sidebar_label: 'Generic MySQL'
description: 'Set up any MySQL instance as a source for ClickPipes'
slug: /integrations/clickpipes/mysql/source/generic
title: 'Generic MySQL source setup guide'
doc_type: 'guide'
keywords: ['generic mysql', 'clickpipes', 'binary logging', 'ssl tls', 'mysql 8.x']
Generic MySQL source ... | {"source_file": "generic.md"} | [
0.01568055897951126,
-0.036091387271881104,
-0.011507035233080387,
-0.002374180592596531,
-0.06354805827140808,
-0.05879431962966919,
0.06612355262041092,
0.02322596125304699,
-0.019476696848869324,
0.024064207449555397,
0.0057025388814508915,
-0.017954878509044647,
0.12588301301002502,
0.... |
dd25bc8a-69fd-4f8e-869d-8fea0bf946d2 | :::
Configure a database user {#configure-database-user}
Connect to your MySQL instance as the root user and execute the following commands:
Create a dedicated user for ClickPipes:
sql
CREATE USER 'clickpipes_user'@'%' IDENTIFIED BY 'some_secure_password';
Grant schema permissions. The following examp... | {"source_file": "generic.md"} | [
-0.005235585849732161,
-0.10496150702238083,
-0.1133747398853302,
-0.01630912721157074,
-0.1228378564119339,
-0.06690864264965057,
0.01372453011572361,
0.0024739450309425592,
-0.07316194474697113,
0.060949284583330154,
-0.029452834278345108,
-0.04494957625865936,
0.15130986273288727,
0.011... |
78823c26-121c-4a56-b570-e287aaba85a0 | sidebar_label: 'Fivetran'
slug: /integrations/fivetran
sidebar_position: 2
description: 'Users can transform and model their data in ClickHouse using dbt'
title: 'Fivetran and ClickHouse Cloud'
doc_type: 'guide'
integration:
- support_level: 'core'
- category: 'data_ingestion'
keywords: ['fivetran', 'data movement'... | {"source_file": "index.md"} | [
-0.07133286446332932,
-0.06462474912405014,
0.022688550874590874,
0.007951483130455017,
0.05457427352666855,
-0.042404964566230774,
0.024270663037896156,
-0.04763435944914818,
-0.044101566076278687,
0.017313797026872635,
0.017888784408569336,
0.010463178157806396,
0.030822405591607094,
-0.... |
ee400530-7b3c-4b85-9f13-2640833c66e2 | sidebar_label: 'Features and configurations'
slug: /integrations/dbt/features-and-configurations
sidebar_position: 2
description: 'Features for using dbt with ClickHouse'
keywords: ['clickhouse', 'dbt', 'features']
title: 'Features and Configurations'
doc_type: 'guide'
import TOCInline from '@theme/TOCInline';
impo... | {"source_file": "features-and-configurations.md"} | [
0.0034042655024677515,
-0.05733044818043709,
-0.00454599317163229,
0.027848469093441963,
0.02874263934791088,
0.039549414068460464,
0.06674493849277496,
0.03440270200371742,
-0.15893971920013428,
-0.04997778311371803,
0.006596881430596113,
-0.008362655527889729,
0.06901327520608902,
-0.041... |
f9bd968b-a516-4973-b406-f9910d8d4625 | ```yaml
your_profile_name:
target: dev
outputs:
dev:
type: clickhouse
# Optional
schema: [default] # ClickHouse database for dbt models
driver: [http] # http or native. If not set this will be autodetermined based on port setting
host: [localhost]
port: [8123] # If not set, defaults to 8123... | {"source_file": "features-and-configurations.md"} | [
0.0413990318775177,
-0.06987661868333817,
-0.055208299309015274,
-0.008686930872499943,
-0.014672712422907352,
-0.08742763847112656,
0.01900842972099781,
-0.00031550726271234453,
-0.07113262265920639,
-0.018118664622306824,
0.008960801176726818,
-0.09501271694898605,
0.11016083508729935,
0... |
c07e5ec9-4f94-44c2-a32a-7b28dbd02dde | # Native (clickhouse-driver) connection settings
sync_request_timeout: [5] # Timeout for server ping
compress_block_size: [1048576] # Compression block size if compression is enabled
```
Schema vs Database {#schema-vs-database}
The dbt model relation identifier
database.schema.table
is not compatible with ... | {"source_file": "features-and-configurations.md"} | [
-0.01916147582232952,
-0.04726153612136841,
-0.03976163640618324,
0.060575369745492935,
-0.0676613599061966,
-0.03164943307638168,
-0.008531956002116203,
-0.0406356006860733,
-0.04747208580374718,
-0.013837139122188091,
-0.010838689282536507,
-0.044217485934495926,
0.06700111925601959,
-0.... |
7d3aa889-afb9-4390-95f0-8b27a652231b | Read-after-write Consistency {#read-after-write-consistency}
dbt relies on a read-after-insert consistency model. This is not compatible with ClickHouse clusters that have more than one replica if you cannot guarantee that all operations will go to the same replica. You may not encounter problems in your day-to-day u... | {"source_file": "features-and-configurations.md"} | [
-0.026861930266022682,
-0.14055362343788147,
0.019464807584881783,
0.05887822434306145,
-0.020754776895046234,
-0.07689456641674042,
0.018332690000534058,
-0.041484981775283813,
0.02252754382789135,
0.026996325701475143,
-0.00010019413457484916,
0.016835471615195274,
0.04937050864100456,
-... |
b4cbbaa8-7527-45ad-9b70-508ecd2ceda5 | | Option | Description ... | {"source_file": "features-and-configurations.md"} | [
0.021959885954856873,
0.043860387057065964,
0.025231484323740005,
0.003765995381399989,
-0.023593224585056305,
0.06336911022663116,
0.039043694734573364,
0.042815200984478,
0.03774546831846237,
-0.039687562733888626,
0.029394395649433136,
-0.06583267450332642,
-0.05396424978971481,
-0.0221... |
93b4e8b9-8e1e-4e5f-9afa-c95bd968406f | | settings | A map/dictionary of "TABLE" settings to be used to DDL statements like 'CREATE TABLE' with this model ... | {"source_file": "features-and-configurations.md"} | [
-0.015184112824499607,
-0.11937858909368515,
-0.14117509126663208,
0.04280603677034378,
-0.11462727934122086,
-0.020504051819443703,
0.08554837107658386,
-0.0037073970306664705,
-0.08870090544223785,
-0.007642765995115042,
0.06871272623538971,
-0.0726625919342041,
0.11295044422149658,
-0.0... |
8fdaf514-90ec-4b8a-b9f9-0d26a6d37619 | About data skipping indexes {#data-skipping-indexes}
Data skipping indexes are only available for the
table
materialization. To add a list of data skipping indexes to a table, use the
indexes
configuration:
sql
{{ config(
materialized='table',
indexes=[{
'name': 'your_index_name',
... | {"source_file": "features-and-configurations.md"} | [
0.01900443434715271,
0.04148910939693451,
0.009065862745046616,
0.1106567308306694,
-0.00864145252853632,
-0.03240638226270676,
-0.014047116972506046,
-0.01260315626859665,
-0.09487340599298477,
0.06926017254590988,
0.03343864902853966,
-0.05761454254388809,
0.06544623523950577,
-0.0432431... |
310754e8-2849-4f06-930e-0a5a8699bd5e | clause used in
CREATE TABLE/VIEW
types of DDL statements, so this is generally settings that are specific to the
specific ClickHouse table engine. The new
query_settings
is use to add a
SETTINGS
clause to the
INSERT
and
DELETE
queries used for model materialization (
including incremental materializations).
T... | {"source_file": "features-and-configurations.md"} | [
-0.03882090747356415,
-0.0705791711807251,
-0.06250513345003128,
0.05918223783373833,
-0.07645449787378311,
0.036351822316646576,
0.04344378411769867,
-0.013264606706798077,
-0.022127583622932434,
0.021945759654045105,
0.05677071958780289,
-0.019905786961317062,
0.05917414650321007,
-0.067... |
dcc77c4f-6681-4ef4-955d-68262b81b652 | ```sql
{{
config(
materialized="materialized_view",
engine="AggregatingMergeTree",
order_by=["event_type"],
)
}}
select
-- event_type may be infered as a String but we may prefer LowCardinality(String):
CAST(event_type, 'LowCardinality(String)') as event_type,
-- countState() may... | {"source_file": "features-and-configurations.md"} | [
0.02399572730064392,
-0.016855141147971153,
0.03924797475337982,
0.05375562235713005,
-0.10377524793148041,
0.044236719608306885,
0.06181870028376579,
0.09448876976966858,
-0.026393748819828033,
-0.0016191485337913036,
-0.02537597343325615,
-0.07882226258516312,
-0.009642193093895912,
0.01... |
436fad11-eb8b-4853-b3e2-fc258f416492 | Configurations {#configurations}
Configurations that are specific for this materialization type are listed below:
| Option | Description ... | {"source_file": "features-and-configurations.md"} | [
0.0001552348112454638,
0.04056110605597496,
-0.015486091375350952,
-0.00006283797847572714,
-0.004365319851785898,
0.0024840268306434155,
0.02330174297094345,
0.020828895270824432,
-0.07476679235696793,
-0.010394182056188583,
-0.03352367877960205,
-0.05341477319598198,
0.017944179475307465,
... |
17e9ad84-1530-412d-a97d-48893bc1fa6c | Incremental Model Strategies {#incremental-model-strategies}
dbt-clickhouse
supports three incremental model strategies.
The Default (Legacy) Strategy {#default-legacy-strategy}
Historically ClickHouse has had only limited support for updates and deletes, in the form of asynchronous "mutations."
To emulate expec... | {"source_file": "features-and-configurations.md"} | [
-0.11280481517314911,
-0.05935269966721535,
-0.001870721927843988,
-0.020812775939702988,
-0.0006924777408130467,
-0.04591212421655655,
-0.03719853609800339,
-0.06309361010789871,
0.05600762367248535,
0.0446094311773777,
0.08619364351034164,
0.08139580488204956,
0.044102225452661514,
-0.04... |
14bd99e9-f5db-4394-bdfa-9a4d6d65e80a | incremental strategy by splitting the increment into predefined time-series batches based on the
event_time
and
batch_size
model configurations.
Beyond handling large transformations, microbatch provides the ability to:
-
Reprocess failed batches
.
- Auto-detect
parallel batch execution
.
- Eliminate the need f... | {"source_file": "features-and-configurations.md"} | [
-0.08063434809446335,
0.008341026492416859,
-0.043705619871616364,
-0.05151398479938507,
-0.08243680745363235,
-0.012421717867255211,
-0.043119315057992935,
-0.011022026650607586,
-0.029019074514508247,
0.021305756643414497,
0.02802494540810585,
-0.0016887838719412684,
-0.032569583505392075,... |
74fe5f9e-6669-47b6-aa21-ba505860f547 | For detailed microbatch usage, refer to the
official documentation
.
Available Microbatch Configurations {#available-microbatch-configurations}
| Option | Description ... | {"source_file": "features-and-configurations.md"} | [
-0.05546864867210388,
-0.012268180958926678,
-0.13254006206989288,
0.016083668917417526,
-0.0857500284910202,
0.035909950733184814,
-0.012851891107857227,
0.033164095133543015,
-0.05260370671749115,
0.00885718036442995,
0.08581750094890594,
-0.03543563559651375,
-0.04374281316995621,
0.028... |
1facdcb4-ea84-4fe0-b49f-df79346bdd11 | The Append Strategy {#append-strategy}
This strategy replaces the
inserts_only
setting in previous versions of dbt-clickhouse. This approach simply appends
new rows to the existing relation.
As a result duplicate rows are not eliminated, and there is no temporary or intermediate table. It is the fastest
approach if... | {"source_file": "features-and-configurations.md"} | [
-0.08691290766000748,
-0.04566085711121559,
0.04666765034198761,
0.008369125425815582,
-0.009021229110658169,
-0.05603525787591934,
-0.06169503554701805,
-0.01280362717807293,
-0.03118463233113289,
0.07160743325948715,
0.06126857548952103,
0.027199506759643555,
0.1153949722647667,
-0.06436... |
7091497a-ed1a-4b4d-bb5c-bcea63081bce | sql
--mv1:begin
select a,b,c from {{ source('raw', 'table_1') }}
--mv1:end
union all
--mv2:begin
select a,b,c from {{ source('raw', 'table_2') }}
--mv2:end
IMPORTANT!
When updating a model with multiple materialized views (MVs), especially when renaming one of the MV names,
dbt-clickhouse does not automatically d... | {"source_file": "features-and-configurations.md"} | [
-0.06693010032176971,
-0.10767332464456558,
0.020315466448664665,
0.04310654103755951,
-0.006115451920777559,
-0.058285344392061234,
-0.00794616062194109,
-0.03971969336271286,
0.045116111636161804,
0.03595351427793503,
0.06126580014824867,
-0.040075961500406265,
0.07265952974557877,
-0.09... |
7565dd75-cc50-45c7-986e-7ad053a95ed0 | To use
Refreshable Materialized View
,
please adjust the following configs as needed in your MV model (all these configs are supposed to be set inside a
refreshable config object):
| Option | Description ... | {"source_file": "features-and-configurations.md"} | [
-0.019935928285121918,
-0.060638610273599625,
0.022912779822945595,
0.05023444816470146,
-0.042371854186058044,
0.024693211540579796,
-0.07853496819734573,
-0.05257532373070717,
0.010332353413105011,
0.05752845108509064,
0.032895904034376144,
-0.04731496423482895,
-0.00975012220442295,
-0.... |
2fe86d59-4a12-4168-86a3-0a7456fbf1e3 | The refreshable feature was not tested with multiple mvs directing to the same target model.
Materialization: dictionary (experimental) {#materialization-dictionary}
See the tests
in https://github.com/ClickHouse/dbt-clickhouse/blob/main/tests/integration/adapter/dictionary/test_dictionary.py for
examples of how ... | {"source_file": "features-and-configurations.md"} | [
-0.03835207596421242,
-0.12284593284130096,
-0.0008856015629135072,
0.07355368137359619,
-0.0046995896846055984,
-0.11722318828105927,
-0.046425554901361465,
-0.05593666434288025,
-0.03763720393180847,
0.08734400570392609,
0.032729923725128174,
0.02205333299934864,
0.09763196110725403,
-0.... |
e9c8986e-23c5-4814-9714-d8edba788930 | select id, created_at, item
from {{ source('db', 'table') }}
```
Generated migrations {#distributed-incremental-generated-migrations}
``sql
CREATE TABLE db.table_local on cluster cluster (
id
UInt64,
created_at
DateTime,
item` String
)
ENGINE = MergeTree
SETTINGS index_granularity = 8192;
CREATE TABLE db.... | {"source_file": "features-and-configurations.md"} | [
-0.02831687405705452,
-0.032859306782484055,
-0.03348561376333237,
0.056526582688093185,
0.028418205678462982,
-0.05283725634217262,
-0.04520552605390549,
-0.0016175154596567154,
-0.010350481607019901,
0.04200001060962677,
0.06147284060716629,
-0.0026596414390951395,
0.06492769718170166,
-... |
93a1fa75-b2b9-4c73-9041-eef9cd4044c4 | ttl_config
-- Uses the
ttl
model configuration property to assign a ClickHouse table TTL expression. No TTL is
assigned by default.
s3Source Helper Macro {#s3source-helper-macro}
The
s3source
macro simplifies the process of selecting ClickHouse data directly from S3 using the ClickHouse S3 table
function. ... | {"source_file": "features-and-configurations.md"} | [
-0.033956848084926605,
-0.08696627616882324,
-0.09889771044254303,
-0.012550354935228825,
-0.04538913443684578,
0.012465616688132286,
0.007560253608971834,
0.011914015747606754,
-0.03180306777358055,
-0.04949292913079262,
0.029889756813645363,
-0.07411758601665497,
0.0746481865644455,
-0.0... |
dffcbbcd-06e4-410f-9f01-871a5fadf8ed | See
the
S3 test file
for examples of how to use this macro.
Cross database macro support {#cross-database-macro-support}
dbt-clickhouse supports most of the cross database macros now included in
dbt Core
with the following exceptions:
The
split_part
SQL function is implemented in ClickHouse using the spli... | {"source_file": "features-and-configurations.md"} | [
-0.04607556387782097,
-0.1309940069913864,
-0.0667564868927002,
0.005522534716874361,
0.020192021504044533,
0.013369043357670307,
0.038135312497615814,
0.041515812277793884,
-0.0828295573592186,
-0.006185587495565414,
0.04242643341422081,
-0.08509376645088196,
0.06967033445835114,
-0.13160... |
2180deac-8dc3-4b71-91ff-72cbac1c6139 | sidebar_label: 'Overview'
slug: /integrations/dbt
sidebar_position: 1
description: 'Users can transform and model their data in ClickHouse using dbt'
title: 'Integrating dbt and ClickHouse'
keywords: ['dbt', 'data transformation', 'analytics engineering', 'SQL modeling', 'ELT pipeline']
doc_type: 'guide'
integration:
... | {"source_file": "index.md"} | [
-0.06473193317651749,
0.01789647713303566,
-0.02870435081422329,
0.08129405230283737,
-0.0028724276926368475,
-0.04099756106734276,
0.07733261585235596,
0.02299988456070423,
-0.09117580205202103,
0.013931102119386196,
0.009837867692112923,
-0.01496619451791048,
0.1335241049528122,
-0.06729... |
339505b8-7841-451f-bc7e-a5954a8b6c0c | dbt provides 4 types of materialization:
view
(default): The model is built as a view in the database.
table
: The model is built as a table in the database.
ephemeral
: The model is not directly built in the database but is instead pulled into dependent models as common table expressions.
incremental
: The ... | {"source_file": "index.md"} | [
-0.12142423540353775,
-0.05203372240066528,
-0.04177965223789215,
0.032758913934230804,
0.052215080708265305,
-0.009164837189018726,
0.016280395910143852,
0.022571559995412827,
-0.015575891360640526,
0.06245487183332443,
-0.022639162838459015,
0.005306809209287167,
0.07835820317268372,
-0.... |
44f9fbce-7b39-4e8c-b667-875fc9cbb3f0 | The following are
experimental features
in ClickHouse:
| Type | Supported? | Details ... | {"source_file": "index.md"} | [
0.006388507317751646,
-0.08650070428848267,
-0.030407244339585304,
-0.019866757094860077,
-0.036342646926641464,
0.017893709242343903,
-0.03781580552458763,
-0.031857140362262726,
-0.11644570529460907,
-0.04309399425983429,
0.05316200107336044,
0.00531554501503706,
-0.011529150418937206,
0... |
4f2aeb54-88dd-4b0c-be96-3eaf3d45c00f | ```
Create a dbt project {#create-a-dbt-project}
You can now use this profile in one of your existing projects or create a new one using:
sh
dbt init project_name
Inside
project_name
dir, update your
dbt_project.yml
file to specify a profile name to connect to the ClickHouse server.
yaml
profile: 'clickho... | {"source_file": "index.md"} | [
-0.0433790422976017,
-0.1273300051689148,
-0.027821781113743782,
-0.024368224665522575,
-0.07089506089687347,
-0.05582740157842636,
0.02245398610830307,
0.013523269444704056,
-0.038805440068244934,
-0.005045617930591106,
0.05533162131905556,
-0.04372427612543106,
0.08129242807626724,
0.018... |
0bb1cc51-f109-4790-b853-8375ee88c480 | If you don't need fresh data to test against, you can restore a backup of your production data into the staging environment.
If you need fresh data to test against, you can use a combination of the
remoteSecure()
table function
and refreshable materialized views to insert at the desired frequency. Another option i... | {"source_file": "index.md"} | [
-0.01662502810359001,
-0.03670461103320122,
0.0026597734540700912,
0.035402704030275345,
-0.05075344070792198,
-0.07942954450845718,
-0.093033067882061,
0.005100106820464134,
-0.049061283469200134,
0.07989440113306046,
0.014875270426273346,
-0.06596611440181732,
0.09117905795574188,
-0.038... |
5557bde6-3977-4efa-aa6b-a6318cb32a05 | The adapter currently materializes models as tables using an
INSERT INTO SELECT
. This effectively means data duplication if the run is executed again. Very large datasets (PB) can result in extremely long run times, making some models unviable. To improve performance, use ClickHouse Materialized Views by implementing... | {"source_file": "index.md"} | [
-0.058570362627506256,
-0.09486763179302216,
-0.02914123795926571,
0.08577495068311691,
0.03688015043735504,
-0.027604445815086365,
-0.07263772934675217,
-0.014210534282028675,
0.001934908446855843,
0.04076046124100685,
0.009541280567646027,
-0.01755603589117527,
0.10014674812555313,
-0.01... |
507b6276-e7a2-43d1-87c1-1fb0dbd3f772 | sidebar_label: 'Guides'
slug: /integrations/dbt/guides
sidebar_position: 2
description: 'Guides for using dbt with ClickHouse'
keywords: ['clickhouse', 'dbt', 'guides']
title: 'Guides'
doc_type: 'guide'
import TOCInline from '@theme/TOCInline';
import Image from '@theme/IdealImage';
import dbt_01 from '@site/static... | {"source_file": "guides.md"} | [
-0.01233262661844492,
0.008591444231569767,
-0.023970142006874084,
-0.0002789038699120283,
0.05275595560669899,
-0.02701646462082863,
0.07973821461200714,
0.08823508769273758,
-0.07052070647478104,
-0.020150719210505486,
0.054030243307352066,
0.02072283998131752,
0.10577423125505447,
-0.07... |
50987f5e-9de8-486b-beef-c1b96ea3f072 | CREATE TABLE imdb.movies
(
id UInt32,
name String,
year UInt32,
rank Float32 DEFAULT 0
) ENGINE = MergeTree ORDER BY (id, name, year);
CREATE TABLE imdb.roles
(
actor_id UInt32,
movie_id UInt32,
role String,
created_at DateTime DEFAULT now()
) ENGINE = MergeTree ORDER BY (a... | {"source_file": "guides.md"} | [
-0.004768258426338434,
-0.1101580485701561,
-0.03953332453966141,
-0.02622779831290245,
0.02101927623152733,
0.048496972769498825,
-0.06101730093359947,
-0.026952559128403664,
0.06313349306583405,
0.036497462540864944,
0.07715633511543274,
-0.03189576044678688,
0.048159703612327576,
-0.035... |
6816edf2-92e3-4ce7-b71f-775fa39f04e7 | sql
SELECT id,
any(actor_name) AS name,
uniqExact(movie_id) AS num_movies,
avg(rank) AS avg_rank,
uniqExact(genre) AS unique_genres,
uniqExact(director_name) AS uniq_directors,
max(created_at) AS updated_at
FROM (
SELECT imdb... | {"source_file": "guides.md"} | [
0.025275370106101036,
-0.12336957454681396,
0.017758257687091827,
0.05767468735575676,
0.008066065609455109,
0.01769194006919861,
0.0764136090874672,
-0.04411866515874863,
0.04010069742798805,
-0.03266497701406479,
0.04173151031136513,
-0.030967796221375465,
0.06638509035110474,
-0.0173478... |
a646a258-249e-4898-b39f-b642f55cf657 | For more information on how to configure the profiles.yml file,
please consult the dbt documentation here:
https://docs.getdbt.com/docs/configure-your-profile
```
cd
into your project folder:
bash
cd imdb
At this point, you will need the text editor of your choice. In the examples below, we use the pop... | {"source_file": "guides.md"} | [
0.020378123968839645,
-0.11827683448791504,
-0.04531465470790863,
-0.024161214008927345,
-0.037788547575473785,
0.02197990193963051,
0.03451855108141899,
0.07679048925638199,
-0.05080542713403702,
-0.004337102174758911,
0.037932686507701874,
-0.081372931599617,
0.054504867643117905,
0.0539... |
dd3a9db8-2868-4c80-bf17-9e52da8cc09e | The file
schema.yml
defines our tables. These will subsequently be available for use in macros. Edit
models/actors/schema.yml
to contain this content:
```yml
version: 2
sources:
- name: imdb
tables:
- name: directors
- name: actors
- name: roles
- name: movies
- name: genres
- name: movie_directors... | {"source_file": "guides.md"} | [
0.0033938889391720295,
-0.12770578265190125,
-0.052901625633239746,
0.04795407876372337,
0.033702950924634933,
0.05770246684551239,
-0.015801480039954185,
0.013906761072576046,
-0.000444895529653877,
0.03122710809111595,
0.05780790373682976,
-0.04439690336585045,
0.03910352662205696,
-0.00... |
13170610-d1f7-4112-90fb-d164af126543 | ``
Note how we include the column
updated_at` in our final actor_summary. We use this later for incremental materializations.
From the
imdb
directory execute the command
dbt run
.
bash
clickhouse-user@clickhouse:~/imdb$ dbt run
15:05:35 Running with dbt=1.1.0
15:05:35 Found 1 model, 0 tests, 1 snapshot, 0 ... | {"source_file": "guides.md"} | [
-0.02218838781118393,
-0.06992053985595703,
-0.07879523187875748,
0.0020351747516542673,
0.03704091161489487,
0.006871294230222702,
0.022057324647903442,
0.012956981547176838,
0.04607877507805824,
0.06120092421770096,
0.05812342092394829,
-0.04477361962199211,
0.0269534420222044,
-0.022224... |
e31f06bb-7d5b-4749-bf9f-3790f75a21a8 | Creating a table materialization {#creating-a-table-materialization}
In the previous example, our model was materialized as a view. While this might offer sufficient performance for some queries, more complex SELECTs or frequently executed queries may be better materialized as a table. This materialization is useful... | {"source_file": "guides.md"} | [
-0.045147594064474106,
0.012968887574970722,
-0.0008003955590538681,
0.055156368762254715,
-0.04089808836579323,
-0.06589400768280029,
0.017407605424523354,
0.055721960961818695,
-0.0010871767299249768,
0.09889841824769974,
-0.022636830806732178,
0.03915572538971901,
0.06368114799261093,
-... |
e7d4bbe7-b16b-4d3d-a19e-ebedc61855d2 | sql
SELECT * FROM imdb_dbt.actor_summary ORDER BY num_movies DESC LIMIT 5;
response
+------+------------+----------+------------------+------+---------+-------------------+
|id |name |num_movies|avg_rank |genres|directors|updated_at |
+------+------------+----------+------------------+-----... | {"source_file": "guides.md"} | [
0.010399043560028076,
-0.06721607595682144,
-0.05374125763773918,
0.009540650062263012,
-0.08303150534629822,
0.14560163021087646,
0.08939184248447418,
0.0010956150945276022,
0.022599870339035988,
-0.013035711832344532,
0.06376751512289047,
-0.07657933980226517,
0.034397926181554794,
-0.02... |
da2c8cf2-468d-4ef0-902a-489f8b8e59a0 | Incremental filter
- We also need to tell dbt how it should identify which rows have changed on an incremental run. This is achieved by providing a delta expression. Typically this involves a timestamp for event data; hence our updated_at timestamp field. This column, which defaults to the value of now() when rows are... | {"source_file": "guides.md"} | [
-0.08502088487148285,
0.0012927528005093336,
0.01667153090238571,
-0.020684782415628433,
-0.009548673406243324,
-0.0004893041332252324,
0.04006238281726837,
-0.03598588705062866,
0.0015792290214449167,
0.040242310613393784,
0.04874466359615326,
0.007427179720252752,
-0.007849852554500103,
... |
5eef6a95-8a21-41f0-8a63-e46d85df3fd8 | -- this filter will only be applied on an incremental run
where id > (select max(id) from {{ this }}) or updated_at > (select max(updated_at) from {{this}})
{% endif %}
```
Note that our model will only respond to updates and additions to the
roles
and
actors
tables. To respond to all tables, users would be enc... | {"source_file": "guides.md"} | [
-0.04354514181613922,
-0.07398024201393127,
0.01634431816637516,
0.01768108829855919,
0.03910934925079346,
-0.0347917266190052,
0.007966750301420689,
-0.012040437199175358,
-0.0010588006116449833,
0.024490665644407272,
-0.011140483431518078,
-0.06705957651138306,
0.027202123776078224,
-0.0... |
fb2d4864-de2c-4e34-9ce6-fde4f1229218 | Confirm he is indeed now the actor with the most appearances by querying the underlying source table and bypassing any dbt models:
sql
SELECT id,
any(actor_name) as name,
uniqExact(movie_id) as num_movies,
avg(rank) as avg_rank,
uniqExact(genre) as unique_genres,
... | {"source_file": "guides.md"} | [
0.029434209689497948,
-0.14742426574230194,
0.008415481075644493,
0.010436632670462132,
0.001784109859727323,
0.03269180282950401,
0.0819353312253952,
-0.010610636323690414,
-0.0016897432506084442,
-0.02699817158281803,
0.037578802555799484,
-0.06874571740627289,
0.06079389527440071,
0.011... |
7bce29a4-4707-48e8-a96c-7ed4225b45b0 | sql
SELECT * FROM imdb_dbt.actor_summary ORDER BY num_movies DESC LIMIT 2;
response
+------+-------------------+----------+------------------+------+---------+-------------------+
|id |name |num_movies|avg_rank |genres|directors|updated_at |
+------+-------------------+----------+---... | {"source_file": "guides.md"} | [
0.02220228686928749,
-0.10603976994752884,
-0.048516228795051575,
0.021725697442889214,
-0.08124566078186035,
0.0824776291847229,
0.08743792027235031,
-0.03617255762219429,
0.014569622464478016,
-0.0192819032818079,
0.06849426031112671,
-0.0683177188038826,
0.03316110372543335,
-0.02967527... |
c92ba7d9-c55b-4033-b4ae-e4fa42ad592e | Let's add another famous actor - Danny DeBito
sql
INSERT INTO imdb.actors VALUES (845467, 'Danny', 'DeBito', 'M');
Let's star Danny in 920 random movies.
sql
INSERT INTO imdb.roles
SELECT now() as created_at, 845467 as actor_id, id as movie_id, 'Himself' as role
FROM imdb.movies
LIMIT 920 OFF... | {"source_file": "guides.md"} | [
-0.034699659794569016,
-0.10816637426614761,
-0.037404611706733704,
-0.014339246787130833,
-0.02825860306620598,
0.011147950775921345,
0.07317725569009781,
0.013431629166007042,
0.03987736999988556,
0.0023495762143284082,
0.06918250769376755,
-0.05780559778213501,
0.035000644624233246,
-0.... |
7f3fb856-82fb-470f-ba68-458699da997a | Note how much faster that incremental was compared to the insertion of "Clicky".
Checking again the query_log table reveals the differences between the 2 incremental runs:
```sql
INSERT INTO imdb_dbt.actor_summary ("id", "name", "num_movies", "avg_rank", "genres", "directors", "updated_at")
WITH actor_summary AS (
... | {"source_file": "guides.md"} | [
-0.0012614296283572912,
-0.1462583690881729,
0.001263786805793643,
0.03729671239852905,
-0.004773785825818777,
0.01141873374581337,
0.04610337316989899,
-0.04791276156902313,
0.02797180414199829,
0.0036298951599746943,
0.10346852242946625,
-0.0116023113951087,
0.07461261004209518,
-0.04128... |
e0283a14-bcb5-422b-9652-a14e28099fcf | A
DELETE
is issued against the current
actor_summary
table. Rows are deleted by id from
actor_sumary__dbt_tmp
The rows from
actor_sumary__dbt_tmp
are inserted into
actor_summary
using an
INSERT INTO actor_summary SELECT * FROM actor_sumary__dbt_tmp
.
This process is shown below:
insert_overwrite mod... | {"source_file": "guides.md"} | [
-0.06078747287392616,
0.01633373834192753,
0.01616501435637474,
-0.013433804735541344,
-0.03193296864628792,
-0.03855878859758377,
-0.01733619160950184,
-0.03936343640089035,
0.031655848026275635,
0.09308232367038727,
0.06190330535173416,
0.009439321234822273,
0.09556639939546585,
-0.02502... |
61a9c00e-b114-46fb-85e5-cb2592b90c96 | ```sql
{{ config(order_by='(updated_at, id, name)', engine='MergeTree()', materialized='incremental', unique_key='id') }}
with actor_summary as (
SELECT id,
any(actor_name) as name,
uniqExact(movie_id) as num_movies,
avg(rank) as avg_rank,
uniqEx... | {"source_file": "guides.md"} | [
0.01278891135007143,
-0.012826301157474518,
0.018273724243044853,
0.02783234417438507,
-0.011723753996193409,
0.045093562453985214,
0.026754511520266533,
-0.022453758865594864,
0.031039385125041008,
-0.004028803203254938,
0.044608402997255325,
-0.0037860991433262825,
0.0466216541826725,
-0... |
f3b46083-6da6-4e92-af7f-6bd2cc55343f | {{
config(
target_schema='snapshots',
unique_key='id',
strategy='timestamp',
updated_at='updated_at',
)
}}
select * from {{ref('actor_summary')}}
{% endsnapshot %}
```
A few observations regarding this content:
* The select query defines the results you wish to snapshot over time. The function ref is used to ... | {"source_file": "guides.md"} | [
-0.07735659182071686,
0.035112008452415466,
-0.045064643025398254,
0.026323776692152023,
0.00950205884873867,
0.0169965997338295,
-0.006178221199661493,
0.03691451996564865,
-0.011379343457520008,
0.05669797956943512,
0.051802512258291245,
-0.03444301337003708,
0.04172607883810997,
-0.0409... |
0f4fd9ef-64da-4baa-b4ed-612f6e730623 | Make our favorite actor Clicky McClickHouse appear in another 10 films.
sql
INSERT INTO imdb.roles
SELECT now() as created_at, 845466 as actor_id, rand(number) % 412320 as movie_id, 'Himself' as role
FROM system.numbers
LIMIT 10;
Re-run the dbt run command from the
imdb
directory. This will update the increme... | {"source_file": "guides.md"} | [
-0.05295247584581375,
-0.12881694734096527,
-0.021399211138486862,
-0.0038095652125775814,
0.012104127556085587,
0.005123215727508068,
0.05253671854734421,
-0.007241642102599144,
0.007749907672405243,
-0.0021344537381082773,
0.0546879880130291,
-0.03144121170043945,
0.0647156611084938,
-0.... |
2a0e977b-f585-471a-8ff5-69c71b0a9ee0 | For further details on dbt snapshots see
here
.
Using seeds {#using-seeds}
dbt provides the ability to load data from CSV files. This capability is not suited to loading large exports of a database and is more designed for small files typically used for code tables and
dictionaries
, e.g. mapping country codes to... | {"source_file": "guides.md"} | [
-0.033233609050512314,
-0.04789420962333679,
-0.11919335275888443,
0.022183429449796677,
0.01481756940484047,
-0.01255329605191946,
0.023430563509464264,
0.02490510232746601,
-0.017514197155833244,
0.03202403709292412,
0.02093886397778988,
-0.03490927442908287,
0.10051579773426056,
-0.1196... |
1123ab9f-ec16-48af-bab4-1ef2f4bcead3 | title: 'Handling other JSON formats'
slug: /integrations/data-formats/json/other-formats
description: 'Handling other JSON formats'
sidebar_label: 'Handling other formats'
keywords: ['json', 'formats', 'json formats']
doc_type: 'guide'
Handling other JSON formats
Earlier examples of loading JSON data assume the u... | {"source_file": "formats.md"} | [
-0.0527598075568676,
-0.02531786449253559,
-0.0890008956193924,
-0.018530787900090218,
0.022221390157938004,
-0.017821863293647766,
-0.04815046861767769,
-0.010855845175683498,
-0.01688406988978386,
-0.03005724586546421,
0.01971530355513096,
0.011721987277269363,
0.0038382818456739187,
-0.... |
d9cf3636-a7c6-4238-a0e4-4f7698c70642 | ```sql
SELECT *
FROM s3('https://datasets-documentation.s3.eu-west-3.amazonaws.com/pypi/json/*.json.gz', JSONAsObject)
LIMIT 5
ββjsonββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β {"country_code":... | {"source_file": "formats.md"} | [
-0.002091890899464488,
-0.05439535155892372,
-0.03445452079176903,
0.004844633862376213,
0.027336129918694496,
-0.017753416672348976,
0.044396646320819855,
-0.05955984443426132,
-0.017123671248555183,
0.040316835045814514,
0.05030498653650284,
-0.07970684766769409,
0.03295881301164627,
-0.... |
f85ba4eb-74c8-4dc4-a97c-b76687635087 | ```sql
SELECT count()
FROM s3('https://clickhouse-public-datasets.s3.amazonaws.com/bluesky/file_0001.json.gz', 'JSONEachRow')
Elapsed: 1.198 sec.
Received exception from server (version 24.12.1):
Code: 636. DB::Exception: Received from sql-clickhouse.clickhouse.com:9440. DB::Exception: The table structure cannot be... | {"source_file": "formats.md"} | [
0.002286441158503294,
-0.05663676932454109,
-0.08700163662433624,
0.027394957840442657,
-0.0021730605512857437,
0.012875129468739033,
-0.0561492033302784,
-0.04505090415477753,
0.000906792061869055,
0.02084658481180668,
0.05156717821955681,
-0.02683599293231964,
0.032462023198604584,
-0.03... |
328d0b39-9d2e-4c66-a907-900625e64599 | In some cases, the list of JSON objects can be encoded as object properties instead of array elements (see
objects.json
for example):
bash
cat objects.json
response
{
"a": {
"path":"April_25,_2017",
"month":"2018-01-01",
"hits":2
},
"b": {
"path":"Akahori_Station",
"month":"2016-06-01",
... | {"source_file": "formats.md"} | [
0.0019304052693769336,
-0.03412023186683655,
-0.06191221997141838,
0.09916286170482635,
-0.11427527666091919,
0.005901035387068987,
-0.008605200797319412,
0.01456056535243988,
-0.019758742302656174,
0.02168957144021988,
-0.024846967309713364,
-0.008582697249948978,
0.01852305792272091,
-0.... |
c468f9e7-0fdf-4363-8fca-b1301afcbb64 | ClickHouse uses the
JSONColumns
format to parse data formatted like that:
sql
SELECT * FROM file('columns.json', JSONColumns)
response
ββpathββββββββββββββββββββββββ¬ββββββmonthββ¬βhitsββ
β 2007_Copa_America β 2016-07-01 β 178 β
β Car_dealerships_in_the_USA β 2015-07-01 β 11 β
β Dihydromyricetin_reducta... | {"source_file": "formats.md"} | [
-0.004212064202874899,
-0.04199429228901863,
-0.045783232897520065,
0.050862688571214676,
-0.03947319835424423,
-0.020649198442697525,
-0.01342195924371481,
0.017875056713819504,
-0.03700365498661995,
-0.003105613635852933,
0.0506904236972332,
0.027294069528579712,
-0.01831665076315403,
-0... |
a808e5ee-bbb5-49d1-838d-9329ddf3c488 | Accessing nested JSON objects {#accessing-nested-json-objects}
We can refer to
nested JSON keys
by enabling the
following settings option
:
sql
SET input_format_import_nested_json = 1
This allows us to refer to nested JSON object keys using dot notation (remember to wrap those with backtick symbols to work):
... | {"source_file": "formats.md"} | [
-0.045817434787750244,
0.011283244006335735,
-0.04140792414546013,
0.07549341768026352,
-0.015084123238921165,
-0.015828516334295273,
-0.026409262791275978,
-0.001003777259029448,
-0.11422248184680939,
0.052470311522483826,
0.08487416058778763,
0.028845377266407013,
0.0605715848505497,
-0.... |
ad89c4bc-4406-44d5-b41b-5f7f821f07cf | title: 'JSON schema inference'
slug: /integrations/data-formats/json/inference
description: 'How to use JSON schema inference'
keywords: ['json', 'schema', 'inference', 'schema inference']
doc_type: 'guide'
ClickHouse can automatically determine the structure of JSON data. This can be used to query JSON data direct... | {"source_file": "inference.md"} | [
-0.030417386442422867,
-0.06538518518209457,
0.000052936291467631236,
0.011287105269730091,
-0.00961039587855339,
-0.017023297026753426,
-0.031498510390520096,
0.012870402075350285,
-0.01758614182472229,
-0.018804216757416725,
0.005173585843294859,
-0.02407781593501568,
-0.003674391889944672... |
88420fc2-e4d5-4cf4-b555-7e99018ad248 | This dataset is stored in a public S3 bucket at
s3://datasets-documentation/arxiv/arxiv.json.gz
.
You can see that the dataset above contains nested JSON objects. While users should draft and version their schemas, inference allows types to be inferred from the data. This allows the schema DDL to be auto-generated, ... | {"source_file": "inference.md"} | [
-0.08407368510961533,
-0.03241639584302902,
-0.07839138060808182,
0.0016806666972115636,
0.04338701814413071,
-0.03801577165722847,
-0.05081552267074585,
-0.05702805519104004,
0.013466068543493748,
-0.0022885578218847513,
0.01445853617042303,
0.02147507853806019,
-0.020382672548294067,
0.0... |
51b8812f-6952-491a-a807-853290d87634 | :::note Controlling type detection
The auto-detection of dates and datetimes can be controlled through the settings
input_format_try_infer_dates
and
input_format_try_infer_datetimes
respectively (both enabled by default). The inference of objects as tuples is controlled by the setting
input_format_json_try_infer_n... | {"source_file": "inference.md"} | [
-0.01753535307943821,
-0.022249985486268997,
-0.03269154950976372,
0.048947062343358994,
-0.024818433448672295,
0.0106349540874362,
-0.03058277629315853,
-0.05956033617258072,
0.021011872217059135,
-0.031223643571138382,
-0.01924831047654152,
-0.02139125019311905,
0.021988768130540848,
0.0... |
f9821876-ebb7-44c4-b344-7f699b384264 | To confirm the table schema, we use the
SHOW CREATE TABLE
command:
```sql
SHOW CREATE TABLE arxiv
CREATE TABLE arxiv
(
id
String,
submitter
String,
authors
String,
title
String,
comments
String,
journal-ref
String,
doi
String,
report-no
String,
categories
Stri... | {"source_file": "inference.md"} | [
0.054981693625450134,
-0.044468577951192856,
-0.027722764760255814,
-0.013744063675403595,
-0.037857141345739365,
-0.058372076600790024,
-0.05244205519556999,
0.0011792370351031423,
-0.03187568113207817,
0.08231606334447861,
0.024259284138679504,
-0.025173602625727654,
0.04053442180156708,
... |
46d40555-2290-4880-933d-3c9c9b0d2a3f | The previous commands created a table to which data can be loaded. You can now insert the data into your table using the following
INSERT INTO SELECT
:
```sql
INSERT INTO arxiv SELECT *
FROM s3('https://datasets-documentation.s3.eu-west-3.amazonaws.com/arxiv/arxiv.json.gz')
0 rows in set. Elapsed: 38.498 sec. Proc... | {"source_file": "inference.md"} | [
-0.011109971441328526,
-0.04325786605477333,
-0.09854180365800858,
0.07228261232376099,
0.0012121518375352025,
-0.062117356806993484,
-0.07226340472698212,
-0.010616936720907688,
0.00738248648121953,
0.051725536584854126,
-0.02358127199113369,
0.06769827008247375,
0.04699162766337395,
-0.1... |
b02d7a94-9754-4832-81f5-48a258561679 | A sample of this data is publicly available in newline-delimited JSON format. If we attempt schema inference on this file, you will find performance is poor with an extremely verbose response:
```sql
DESCRIBE s3('https://datasets-documentation.s3.eu-west-3.amazonaws.com/pypi/pypi_with_tags/sample_rows.json.gz')
-- ... | {"source_file": "inference.md"} | [
-0.048490896821022034,
-0.04403684288263321,
-0.09632799029350281,
0.0004124654224142432,
0.0031432481482625008,
-0.039787378162145615,
-0.044447652995586395,
0.008426724933087826,
-0.00010040076449513435,
-0.009828047826886177,
0.0040880776941776276,
-0.014620402827858925,
0.012029445730149... |
1f9727cc-e578-45fb-ab6b-9fa7caef7b62 | In this case,
JSONAsObject
considers each row as a single
JSON
type (which supports the same column having multiple types). This is essential:
```sql
DESCRIBE TABLE s3('https://datasets-documentation.s3.eu-west-3.amazonaws.com/json/conflict_sample.json', JSONAsObject)
SETTINGS enable_json_type = 1, describe_compa... | {"source_file": "inference.md"} | [
-0.01714223064482212,
-0.057293932884931564,
-0.039564624428749084,
0.025576146319508553,
0.0007559729856438935,
0.005730268079787493,
-0.029488639906048775,
0.0007532874587923288,
-0.008421946316957474,
-0.006619669031351805,
-0.019711339846253395,
-0.03317929804325104,
-0.00063823407981544... |
2e40fd5c-841f-4986-aa35-b23e46bf8feb | title: 'Exporting JSON'
slug: /integrations/data-formats/json/exporting
description: 'How to export JSON data from ClickHouse'
keywords: ['json', 'clickhouse', 'formats', 'exporting']
doc_type: 'guide'
Exporting JSON
Almost any JSON format used for import can be used for export as well. The most popular is
JSONE... | {"source_file": "exporting.md"} | [
0.02016870491206646,
-0.026894647628068924,
-0.044497765600681305,
0.05480501428246498,
-0.026367299258708954,
-0.010559620335698128,
-0.03368469700217247,
0.023343052715063095,
-0.03361112251877785,
0.05271930992603302,
0.03912550210952759,
-0.019059468060731888,
0.015719937160611153,
-0.... |
0ebafe09-db02-47c0-9466-07e118c45548 | "data":
[
["Bob_Dolman", "2016-11-01", 245],
["1-krona", "2017-01-01", 4],
["Ahmadabad-e_Kalij-e_Sofla", "2017-01-01", 3]
],
"rows": 3,
"statistics":
{
"elapsed": 0.00074981,
"rows_read": 3,
"bytes_read": 87
}
}
```
C... | {"source_file": "exporting.md"} | [
0.020308904349803925,
0.029433824121952057,
-0.02380331978201866,
0.04832612723112106,
-0.07498255372047424,
-0.0041681877337396145,
0.008779365569353104,
-0.005565118044614792,
-0.012108935043215752,
0.024070672690868378,
-0.0013698333641514182,
-0.029539702460169792,
0.010706006549298763,
... |
0119c999-4f60-45f9-8ab5-32a29f141f56 | title: 'Designing JSON schema'
slug: /integrations/data-formats/json/schema
description: 'How to optimally design JSON schemas'
keywords: ['json', 'clickhouse', 'inserting', 'loading', 'formats', 'schema', 'structured', 'semi-structured']
score: 20
doc_type: 'guide'
import Image from '@theme/IdealImage';
import jso... | {"source_file": "schema.md"} | [
-0.02649683877825737,
0.03171148523688316,
-0.037379950284957886,
-0.019469229504466057,
0.019119882956147194,
-0.02363995462656021,
-0.06584491580724716,
0.1179656907916069,
-0.05876104161143303,
0.02331135980784893,
0.06370853632688522,
-0.006319480948150158,
0.08719755709171295,
0.11205... |
48047613-4b8e-4817-95b5-81cf8ce12db4 | To illustrate these rules, we use the following JSON example representing a person:
json
{
"id": 1,
"name": "Clicky McCliickHouse",
"username": "Clicky",
"email": "clicky@clickhouse.com",
"address": [
{
"street": "Victor Plains",
"suite": "Suite 879",
"city": "Wisokyburgh",
"zipc... | {"source_file": "schema.md"} | [
-0.08305013179779053,
0.051709141582250595,
-0.026611018925905228,
0.026764342561364174,
0.013114969246089458,
-0.0988125130534172,
0.028503013774752617,
-0.07697287201881409,
0.02191748097538948,
-0.0359293669462204,
-0.0044175987131893635,
-0.05006497725844383,
0.0577697828412056,
0.0278... |
367082c6-0843-41f4-b36e-26af285f0195 | To illustrate this, we use the earlier JSON person example, omitting the dynamic objects:
json
{
"id": 1,
"name": "Clicky McCliickHouse",
"username": "Clicky",
"email": "clicky@clickhouse.com",
"address": [
{
"street": "Victor Plains",
"suite": "Suite 879",
"city": "Wisokyburgh",
... | {"source_file": "schema.md"} | [
-0.04755961149930954,
0.05070715397596359,
-0.005394116975367069,
0.07941964268684387,
-0.058292511850595474,
-0.0697142630815506,
0.04309057071805,
-0.0031915237195789814,
0.0171853918582201,
-0.0161018967628479,
0.019658846780657768,
-0.044054459780454636,
0.0381181575357914,
0.010759891... |
3ef500c7-52c9-4e9d-8514-6a2d3508f70f | Handling default values {#handling-default-values}
Even if JSON objects are structured, they are often sparse with only a subset of the known keys provided. Fortunately, the
Tuple
type does not require all columns in the JSON payload. If not provided, default values will be used.
Consider our earlier
people
tab... | {"source_file": "schema.md"} | [
-0.02908596582710743,
-0.03373142331838608,
0.03138547018170357,
0.012888372875750065,
-0.06226607412099838,
-0.04332313686609268,
0.032271575182676315,
-0.03395109996199608,
-0.002009517513215542,
-0.040565125644207,
0.050021059811115265,
-0.029862092807888985,
0.009638202376663685,
0.005... |
eff00d35-dc66-432f-8888-61ad68464adb | json
{
"id": 1,
"name": "Clicky McCliickHouse",
"nickname": "Clicky",
"username": "Clicky",
"email": "clicky@clickhouse.com",
"address": [
{
"street": "Victor Plains",
"suite": "Suite 879",
"city": "Wisokyburgh",
"zipcode": "90566-7771",
"geo": {
"lat": -43.9509,
... | {"source_file": "schema.md"} | [
-0.10205905884504318,
0.03266925737261772,
0.0035595244262367487,
0.024909919127821922,
-0.0691540315747261,
-0.05755404382944107,
0.024874472990632057,
-0.021455751731991768,
0.005398730281740427,
-0.03730104863643646,
0.009599324315786362,
-0.03370531275868416,
0.03792116045951843,
0.011... |
a8dcd357-b0b8-43fa-b71b-6336e95dcde6 | -- select 2 rows
SELECT id, nickname FROM people
ββidββ¬βnicknameβββββ
β 2 β Clicky β
β 1 β no_nickname β
ββββββ΄ββββββββββββββ
2 rows in set. Elapsed: 0.001 sec.
```
Handling semi-structured/dynamic structures {#handling-semi-structured-dynamic-structures}
If JSON data is semi-structured where keys can be... | {"source_file": "schema.md"} | [
-0.07419990003108978,
0.03142847493290901,
0.02652967907488346,
0.0372653603553772,
-0.09544886648654938,
-0.05735393241047859,
0.0661630854010582,
0.008750040084123611,
0.041345659643411636,
-0.10417002439498901,
0.017394578084349632,
-0.026086708530783653,
-0.020534295588731766,
0.033633... |
c1875381-d86c-412e-bb0c-520df5d27deb | Given the dynamic nature of the
company.labels
column between objects, with respect to keys and types, we have several options to model this data:
Single JSON column
- represents the entire schema as a single
JSON
column, allowing all structures to be dynamic beneath this.
Targeted JSON column
- only use th... | {"source_file": "schema.md"} | [
-0.0466514490544796,
0.02896975167095661,
-0.060750268399715424,
0.0016985888360068202,
-0.023867128416895866,
-0.058751583099365234,
-0.0528600700199604,
0.02043718844652176,
-0.0030590093228965998,
-0.07854612171649933,
0.0009463352616876364,
-0.020740022882819176,
0.013671834953129292,
... |
9d96e348-b1e2-4c22-ab26-9388b31a121b | The schema for a single JSON column here is simple:
```sql
SET enable_json_type = 1;
CREATE TABLE people
(
json
JSON(username String)
)
ENGINE = MergeTree
ORDER BY json.username;
```
:::note
We provide a
type hint
for the
username
column in the JSON definition as we use it in the ordering/primary key. T... | {"source_file": "schema.md"} | [
-0.02160363644361496,
-0.04815559834241867,
0.02720286324620247,
0.02153933420777321,
-0.12158939987421036,
-0.014857095666229725,
-0.00894866045564413,
0.04706616327166557,
-0.04128436744213104,
0.018781138584017754,
0.04898693412542343,
-0.02633354812860489,
0.03331414610147476,
0.008438... |
53d18a76-d348-4b82-9b50-1e79b9e48fc3 | Row 2:
ββββββ
json: {"address":[{"city":"Wisokyburgh","geo":{"lat":-43.9509,"lng":-34.4618},"street":"Victor Plains","suite":"Suite 879","zipcode":"90566-7771"}],"company":{"catchPhrase":"The real-time data warehouse for analytics","labels":{"employees":"250","founded":"2021","type":"database systems"},"name":"ClickHou... | {"source_file": "schema.md"} | [
-0.07795587927103043,
0.07636984437704086,
-0.0066656265407800674,
0.020512185990810394,
-0.011780946515500546,
-0.050355084240436554,
0.0160971749573946,
-0.05129396170377731,
0.028718460351228714,
-0.029973933473229408,
0.013584358617663383,
-0.0401092991232872,
0.037306200712919235,
-0.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.