id stringlengths 36 36 | document stringlengths 3 3k | metadata stringlengths 23 69 | embeddings listlengths 384 384 |
|---|---|---|---|
a6f00e4c-f138-4411-b29e-51a11337f354 | description: 'Analyzing Stack Overflow data with ClickHouse'
sidebar_label: 'Stack Overflow'
slug: /getting-started/example-datasets/stackoverflow
title: 'Analyzing Stack Overflow data with ClickHouse'
keywords: ['StackOverflow']
show_related_blogs: true
doc_type: 'guide'
import Image from '@theme/IdealImage';
impo... | {"source_file": "stackoverflow.md"} | [
-0.0555989146232605,
-0.07065937668085098,
-0.04877786338329315,
-0.02111412025988102,
0.005500933155417442,
-0.06630989909172058,
-0.040108732879161835,
-0.008842880837619305,
-0.07634390145540237,
0.02451350912451744,
0.046524371951818466,
0.02764245681464672,
0.0408359058201313,
-0.0656... |
ea839310-216d-49a3-b4ed-d768653a38fb | Posts are also available by year e.g.
https://datasets-documentation.s3.eu-west-3.amazonaws.com/stackoverflow/parquet/posts/2020.parquet
Votes {#votes}
``sql
CREATE TABLE stackoverflow.votes
(
Id
UInt32,
PostId
Int32,
VoteTypeId
UInt8,
CreationDate
DateTime64(3, 'UTC'),
UserId
Int32,
BountyAmount` UInt8
)
ENGINE =... | {"source_file": "stackoverflow.md"} | [
-0.007549068424850702,
-0.05592484399676323,
-0.06792504340410233,
-0.04330500215291977,
-0.031563159078359604,
-0.004585457034409046,
-0.08415670692920685,
-0.04538687318563461,
-0.012181833386421204,
0.05873578414320946,
0.04398267716169357,
-0.03661414608359337,
0.04491127282381058,
-0.... |
3561dd52-3697-45fc-a08e-5c3c33655244 | INSERT INTO stackoverflow.postlinks SELECT * FROM s3('https://datasets-documentation.s3.eu-west-3.amazonaws.com/stackoverflow/parquet/postlinks.parquet')
0 rows in set. Elapsed: 1.534 sec. Processed 6.55 million rows, 129.70 MB (4.27 million rows/s., 84.57 MB/s.)
```
PostHistory {#posthistory}
``sql
CREATE TABLE ... | {"source_file": "stackoverflow.md"} | [
0.013304785825312138,
-0.04538374021649361,
-0.01839279755949974,
-0.017733322456479073,
-0.016518518328666687,
-0.043860211968421936,
-0.04967617243528366,
-0.01027363259345293,
0.010674695484340191,
0.07163781672716141,
0.054438184946775436,
-0.03165760263800621,
0.029764298349618912,
-0... |
1f00c910-5b73-45dc-baf1-31fa57d221d7 | the following splits the input xml file into sub files of 10000 rows
tail +3 ../Posts.xml | head -n -1 | split -l 10000 --filter='{ printf "
\n"; cat - ; printf "
\n"; } > $FILE' -
```
After running the above users will have a set of files, each with 10000 lines. This ensures the memory overhead of the next command... | {"source_file": "stackoverflow.md"} | [
-0.0044048079289495945,
0.04103937745094299,
-0.03946451470255852,
-0.02100895158946514,
-0.025658229365944862,
-0.042004749178886414,
-0.0513017401099205,
0.03993614763021469,
-0.08295471966266632,
0.030082356184720993,
0.07353321462869644,
0.01608315482735634,
0.04689130187034607,
-0.069... |
b5a917cf-800e-483b-9fe6-fb548e5a01f9 | 5 rows in set. Elapsed: 0.154 sec. Processed 35.83 million rows, 193.39 MB (232.33 million rows/s., 1.25 GB/s.)
Peak memory usage: 206.45 MiB.
```
ClickHouse related posts with the most views {#clickhouse-related-posts-with-the-most-views}
```sql
SELECT
Id,
Title,
ViewCount,
AnswerCount
FROM stackov... | {"source_file": "stackoverflow.md"} | [
0.04296940937638283,
-0.08368399739265442,
-0.0486297532916069,
0.023171525448560715,
0.00006333375495159999,
-0.0755278542637825,
0.06990724056959152,
-0.11331229656934738,
-0.06707562506198883,
0.05216437950730324,
0.00801677256822586,
0.04348859563469887,
0.02135983668267727,
-0.0893739... |
29f9e92d-6d0b-47c6-af94-867daa6e9a4e | ┌───────Id─┬─Title─────────────────────────────────────────────┬─UpVotes─┬─DownVotes─┬─Controversial_ratio─┐
│ 583177 │ VB.NET Infinite For Loop │ 12 │ 12 │ 0 │
│ 9756797 │ Read console input as enumerable - one statement? │ 16 │ 16 │ ... | {"source_file": "stackoverflow.md"} | [
-0.04462939128279686,
-0.029131973162293434,
-0.12782156467437744,
0.06131921336054802,
0.0594952218234539,
-0.01720597594976425,
0.0855984091758728,
0.014826656319200993,
0.0045952280052006245,
0.05618491768836975,
0.029355114325881004,
0.06190676614642143,
0.029536942020058632,
-0.089220... |
aadd407c-f159-49d2-8859-7017868807f2 | description: 'A benchmark dataset used for comparing the performance of data warehousing
solutions.'
sidebar_label: 'AMPLab big data benchmark'
slug: /getting-started/example-datasets/amplab-benchmark
title: 'AMPLab Big Data Benchmark'
keywords: ['AMPLab benchmark', 'big data benchmark', 'data warehousing performance... | {"source_file": "amplab-benchmark.md"} | [
-0.012041634880006313,
-0.005667226389050484,
-0.07685990631580353,
0.006834692787379026,
-0.005395431071519852,
0.009529950097203255,
-0.01929505355656147,
-0.02596629224717617,
-0.007739698980003595,
0.08619223535060883,
0.03293373063206673,
-0.06020122393965721,
0.08382884413003922,
-0.... |
2917c397-ab3e-416a-a0cd-7589e531880d | Go back to the console:
bash
$ for i in tiny/rankings/*.deflate; do echo $i; zlib-flate -uncompress < $i | clickhouse-client --host=example-perftest01j --query="INSERT INTO rankings_tiny FORMAT CSV"; done
$ for i in tiny/uservisits/*.deflate; do echo $i; zlib-flate -uncompress < $i | clickhouse-client --host=example-... | {"source_file": "amplab-benchmark.md"} | [
-0.004439384676516056,
0.041020508855581284,
-0.0610155388712883,
0.03499449044466019,
0.031902994960546494,
-0.04726308956742287,
0.04527788981795311,
0.058893825858831406,
-0.027491049841046333,
0.0014321791240945458,
-0.018497701734304428,
-0.04958995431661606,
0.07146207243204117,
-0.0... |
89e4f29d-619b-4d69-af7a-f350009ff9a6 | description: 'Dataset containing 1.3 million records of historical data on the menus
of hotels, restaurants and cafes with the dishes along with their prices.'
sidebar_label: 'New York Public Library "what''s on the menu?" dataset'
slug: /getting-started/example-datasets/menus
title: 'New York Public Library "What''s... | {"source_file": "menus.md"} | [
0.014126772060990334,
-0.02661065012216568,
-0.01938910409808159,
0.06018206477165222,
-0.02126680687069893,
-0.04478012025356293,
-0.03740381449460983,
-0.048932965844869614,
-0.025671174749732018,
-0.03244480490684509,
0.052993424236774445,
0.015272696502506733,
-0.02129611000418663,
-0.... |
4eb7f293-bf84-4b97-a3b3-47191e86a649 | CREATE TABLE menu_item
(
id UInt32,
menu_page_id UInt32,
price Decimal64(3),
high_price Decimal64(3),
dish_id UInt32,
created_at DateTime,
updated_at DateTime,
xpos Float64,
ypos Float64
) ENGINE = MergeTree ORDER BY id;
```
Import the data {#import-data}
Upload data into ClickHo... | {"source_file": "menus.md"} | [
0.029685137793421745,
0.013021045364439487,
-0.045838162302970886,
0.014542915858328342,
-0.09279525279998779,
-0.012507851235568523,
-0.022189384326338768,
0.00649477681145072,
-0.00907893292605877,
0.05311179533600807,
0.02655407413840294,
-0.06782548129558563,
0.07486134767532349,
-0.10... |
9b8de275-e8ad-46a9-a799-4aee2f41b163 | We will create a table
menu_item_denorm
where will contain all the data JOINed together:
sql
CREATE TABLE menu_item_denorm
ENGINE = MergeTree ORDER BY (dish_name, created_at)
AS SELECT
price,
high_price,
created_at,
updated_at,
xpos,
ypos,
dish.id AS dish_id,
dish.name AS dish_name,
... | {"source_file": "menus.md"} | [
0.04972713068127632,
-0.0052758376114070415,
0.03126174211502075,
0.022349229082465172,
-0.11134755611419678,
-0.041168197989463806,
0.028642011806368828,
0.001489518559537828,
-0.004906664602458477,
0.0048579927533864975,
0.05011281371116638,
-0.04082528501749039,
0.05153612792491913,
-0.... |
27709b77-fab1-4c82-b740-8e80866f824e | Result:
text
┌────d─┬─count()─┬─round(avg(price), 2)─┬─bar(avg(price), 0, 100, 100)─┐
│ 1850 │ 618 │ 1.5 │ █▍ │
│ 1860 │ 1634 │ 1.29 │ █▎ │
│ 1870 │ 2215 │ 1.36 │ █▎ │
│ 1880 │ 3... | {"source_file": "menus.md"} | [
-0.04816589131951332,
0.06083197146654129,
0.019410349428653717,
0.0467778742313385,
0.006384065840393305,
-0.036016445606946945,
0.06004054471850395,
0.004402699880301952,
0.050768088549375534,
0.016238965094089508,
0.12048011273145676,
-0.0368637852370739,
0.07903485000133514,
-0.0408255... |
f64559fa-c774-4ac1-b398-f85d8d8b13f0 | Result:
text
┌────d─┬─count()─┬─round(avg(price), 2)─┬─bar(avg(price), 0, 50, 100)───────────┐
│ 1880 │ 2 │ 0.42 │ ▋ │
│ 1890 │ 7 │ 0.85 │ █▋ │
│ 1900 │ 399 │ 0.49 │ ▊ ... | {"source_file": "menus.md"} | [
-0.004482722375541925,
0.017811201512813568,
-0.018437540158629417,
0.06402837485074997,
-0.03168958052992821,
0.04962163418531418,
0.09908314049243927,
0.01081617921590805,
0.0322403609752655,
0.017202841117978096,
0.03657202795147896,
-0.09758830815553665,
0.006497527938336134,
-0.058473... |
1a29728f-2a13-4dd1-8c78-c95d1b2a40f1 | Result: | {"source_file": "menus.md"} | [
0.007483392022550106,
0.1033942848443985,
-0.02604025974869728,
0.038094211369752884,
-0.0537632554769516,
-0.004921757150441408,
0.03738363832235336,
0.11665063351392746,
-0.05675116553902626,
-0.003935408778488636,
0.09119946509599686,
-0.02751018851995468,
0.03642028197646141,
0.0522339... |
5a64c838-a89b-4e65-adb7-1dade2ab4fc6 | text
┌────d─┬─count()─┬─round(avg(price), 2)─┬─bar(avg(price), 0, 50, 100)──────┬─any(dish_name)──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ 1090 │ 1 │ 0 │ │ Caviar ... | {"source_file": "menus.md"} | [
-0.05346336588263512,
-0.009898931719362736,
-0.01658625528216362,
0.03553564473986626,
-0.07418005913496017,
-0.015394525602459908,
0.03604670241475105,
-0.017906220629811287,
-0.00023219348804559559,
-0.031808678060770035,
0.13472780585289001,
-0.12545570731163025,
0.015855353325605392,
... |
390c166f-ed50-4fcf-87dd-82b73ece06f0 | │ 2000 │ 3 │ 7.82 │ ███████████████▋ │ Aufgeschlagenes Kartoffelsueppchen mit Forellencaviar │
│ 2010 │ 6 │ 15.58 │ ███████████████████████████████▏ │ "OYSTERS AND PEARLS" "Sabayon" o... | {"source_file": "menus.md"} | [
-0.007249005138874054,
0.027505991980433464,
0.038863375782966614,
0.02637113444507122,
-0.05918068811297417,
0.04644770175218582,
0.04888466000556946,
-0.0018960725283250213,
0.0007693198276683688,
-0.03599543496966362,
0.0818987637758255,
-0.10050923377275467,
0.02185722254216671,
-0.063... |
0123c92f-7eb6-412e-ac1e-40ab4b3d0db8 | At least they have caviar with vodka. Very nice.
Online playground {#playground}
The data is uploaded to ClickHouse Playground,
example
. | {"source_file": "menus.md"} | [
-0.034649964421987534,
-0.06154809147119522,
-0.04118216782808304,
-0.026053536683321,
0.022442681714892387,
0.022803789004683495,
0.016289375722408295,
0.013227308169007301,
-0.022428324446082115,
-0.07195915281772614,
0.015531257726252079,
0.0016512047732248902,
0.00432174326851964,
0.05... |
8adc2cc1-d0ec-40bd-bc8e-908419028e58 | description: 'Dataset containing 100 million vectors from the LAION 5B dataset'
sidebar_label: 'LAION 5B dataset'
slug: /getting-started/example-datasets/laion-5b-dataset
title: 'LAION 5B dataset'
keywords: ['semantic search', 'vector similarity', 'approximate nearest neighbours', 'embeddings']
doc_type: 'guide'
im... | {"source_file": "laion5b.md"} | [
-0.025919299572706223,
-0.04346559941768646,
-0.01157772820442915,
0.0028313128277659416,
0.09434307366609573,
0.0007430905825458467,
-0.05732916295528412,
0.03750048577785492,
0.03215331956744194,
-0.07474994659423828,
0.05953744053840637,
-0.0052335369400680065,
0.003190485294908285,
-0.... |
c329f147-93cc-4021-8bde-fcf696a7398e | Run a brute-force vector similarity search {#run-a-brute-force-vector-similarity-search}
KNN (k - Nearest Neighbours) search or brute force search involves calculating the distance of each vector in the dataset
to the search embedding vector and then ordering the distances to get the nearest neighbours. We can use on... | {"source_file": "laion5b.md"} | [
0.00010812010441441089,
-0.04637664556503296,
-0.009314987808465958,
-0.07781725376844406,
0.02056848630309105,
0.007455630227923393,
-0.0072828633710742,
-0.07521859556436539,
0.01754099875688553,
-0.05472985655069351,
0.02376488968729973,
0.011248166672885418,
0.10064314305782318,
-0.032... |
12fe909d-1524-4d41-b5e0-f823cea09931 | ```response title="Response"
┌───────id─┬─url───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
1. │ 9999 │ https://certapro.com/bellevil... | {"source_file": "laion5b.md"} | [
-0.07256560027599335,
0.06834319978952408,
0.04615605250000954,
-0.01643037423491478,
0.10277333110570908,
-0.03818848729133606,
-0.020111287012696266,
0.012332482263445854,
0.02968529798090458,
0.02945331111550331,
0.007435073610395193,
-0.059861764311790466,
0.021922210231423378,
0.03277... |
206d75b1-fd96-41ee-8212-b28e48d58383 | 12. │ 95371605 │ http://www.restaurantmagazine.com/wp-content/uploads/2015/08/McAlisters-Deli-Signs-Development-Agreement-with-Kingdom-Foods-to-Grow-in-Southern-Mississippi.jpg │
13. │ 79564563 │ https://www.restaurantmagazine.com/wp-content/uploads/2016... | {"source_file": "laion5b.md"} | [
-0.029831862077116966,
-0.05677713081240654,
0.07421695441007614,
-0.0242166630923748,
-0.03870689496397972,
-0.025928469374775887,
-0.07339634001255035,
-0.0805910974740982,
0.03524506837129593,
-0.010857117362320423,
0.10451507568359375,
-0.04244714975357056,
-0.019797654822468758,
-0.00... |
88c2a616-dd5d-457e-bf0f-f17a8fb980ab | highlight-next-line
20 rows in set. Elapsed: 3.968 sec. Processed 100.38 million rows, 320.81 GB (25.30 million rows/s., 80.84 GB/s.)
```
Note down the query latency so that we can compare it with the query latency of ANN (using vector index).
With 100 million rows, the above query without a vector index could take... | {"source_file": "laion5b.md"} | [
0.015218972228467464,
-0.014162149280309677,
-0.04911211505532265,
0.010046599432826042,
0.03863164037466049,
-0.020791012793779373,
-0.054747916758060455,
-0.04377353563904762,
-0.019710658118128777,
-0.025338441133499146,
0.005421491805464029,
-0.004940899088978767,
-0.06347338110208511,
... |
69c4be1a-720b-4519-b6d8-83144d31751f | params = {'v1': list(np_arr[0])}
result = chclient.query("SELECT id, url FROM laion_5b_100m ORDER BY cosineDistance(vector, %(v1)s) LIMIT 100",
parameters=params)
# Write the results to a simple HTML page that can be opened in the browser. Some URLs may have become obsolete.
print("<html>")
for... | {"source_file": "laion5b.md"} | [
-0.02714540809392929,
0.13550950586795807,
-0.07313954085111618,
0.03777614235877991,
0.0246144849807024,
-0.024527983739972115,
-0.03477257117629051,
0.0537831075489521,
-0.022854559123516083,
-0.0023093034978955984,
0.01734817959368229,
0.012825844809412956,
0.08802203834056854,
-0.07742... |
468eb19e-8d76-425c-b40a-12516474201d | description: 'Dataset containing 400 million images with English image captions'
sidebar_label: 'Laion-400M dataset'
slug: /getting-started/example-datasets/laion-400m-dataset
title: 'Laion-400M dataset'
doc_type: 'guide'
keywords: ['example dataset', 'laion', 'image embeddings', 'sample data', 'machine learning']
... | {"source_file": "laion.md"} | [
0.003546610474586487,
-0.08232348412275314,
-0.05357813462615013,
-0.03721196576952934,
0.10139476507902145,
0.0032659582793712616,
-0.08307401090860367,
0.019370656460523605,
0.006189498119056225,
-0.04640531912446022,
0.0683797225356102,
-0.0375276617705822,
0.06851758062839508,
0.021739... |
ed894c31-5a5a-4176-8fac-79d16f8d3178 | removed raw data files
os.system(f"rm {npy_file} {metadata_file} {text_npy}")
```
To start the data preparation pipeline, run:
bash
seq 0 409 | xargs -P1 -I{} bash -c './download.sh {}'
The dataset is split into 410 files, each file contains ca. 1 million rows. If you like to work with a smaller subset of the d... | {"source_file": "laion.md"} | [
0.010277839377522469,
0.042677637189626694,
-0.07570677250623703,
0.004984061233699322,
0.0013032867573201656,
-0.12813958525657654,
-0.004250957164913416,
0.04040190950036049,
-0.005421914160251617,
0.11166591942310333,
0.026593396440148354,
0.010647875256836414,
0.03214640915393829,
-0.0... |
60cd9082-b1db-48fe-a12c-9b68bc5a7e70 | ```markdown
┌─url───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬─caption──────────────────────────────────────────────────────────────────────────┐
1. │ https://s4.thcdn.com/... | {"source_file": "laion.md"} | [
-0.05542638897895813,
-0.005656868685036898,
0.09136214107275009,
-0.06483791023492813,
-0.007761979475617409,
0.04853151738643646,
0.019663291051983833,
-0.022306323051452637,
-0.03868233039975166,
0.018644142895936966,
0.07000914961099625,
-0.018147194758057594,
0.011523451656103134,
0.0... |
5c369438-9efd-4c0b-aaaa-11e8cc23acd0 | 10. │ http://www.ibrickcity.com/wp-content/gallery/41057/thumbs/thumbs_lego-41057-heartlake-horse-show-friends-3.jpg │ lego-41057-heartlake-horse-show-friends-3 │
└──────────────────────────────────... | {"source_file": "laion.md"} | [
-0.11354692280292511,
0.02860233187675476,
0.06911636888980865,
-0.04152757301926613,
0.03564563766121864,
0.04875311627984047,
0.03726830333471298,
0.07025783509016037,
-0.008763263933360577,
-0.06363783031702042,
0.09812081605195999,
-0.04579614847898483,
0.07423686236143112,
0.018552014... |
3b9fb43b-dc1f-4991-a7c9-d7e7ede2d1cb | 10 rows in set. Elapsed: 4.605 sec. Processed 100.38 million rows, 309.98 GB (21.80 million rows/s., 67.31 GB/s.)
```
Run an approximate vector similarity search with a vector similarity index {#run-an-approximate-vector-similarity-search-with-a-vector-similarity-index}
Let's now define two vector similarity indexe... | {"source_file": "laion.md"} | [
0.024062365293502808,
-0.023934632539749146,
-0.04856732115149498,
0.005118084605783224,
0.01669824868440628,
0.01980140432715416,
-0.03104589693248272,
0.017098646610975266,
-0.057377010583877563,
-0.0512339249253273,
0.018569715321063995,
0.0059904493391513824,
0.030732419341802597,
-0.0... |
4fbffb04-2826-44b6-8a3f-1d121524d638 | ```response
┌─url───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬─caption──────────────────────────────────────────────────────────────────────────┐
1. │ https://s4.thcdn.com/... | {"source_file": "laion.md"} | [
-0.0641222596168518,
-0.010433685965836048,
0.09232150763273239,
-0.060165807604789734,
-0.016785413026809692,
0.03549593314528465,
0.028959309682250023,
-0.019841652363538742,
-0.030058523640036583,
0.0202629454433918,
0.07869837433099747,
-0.03624383360147476,
0.015212235040962696,
0.054... |
a47d43ae-c824-4250-9971-8dc308518dd1 | 10. │ http://www.ibrickcity.com/wp-content/gallery/41057/thumbs/thumbs_lego-41057-heartlake-horse-show-friends-3.jpg │ lego-41057-heartlake-horse-show-friends-3 │
└──────────────────────────────────... | {"source_file": "laion.md"} | [
-0.11354692280292511,
0.02860233187675476,
0.06911636888980865,
-0.04152757301926613,
0.03564563766121864,
0.04875311627984047,
0.03726830333471298,
0.07025783509016037,
-0.008763263933360577,
-0.06363783031702042,
0.09812081605195999,
-0.04579614847898483,
0.07423686236143112,
0.018552014... |
ac7b2420-79af-4e28-a9d8-1136d0ed4f69 | 10 rows in set. Elapsed: 0.019 sec. Processed 137.27 thousand rows, 24.42 MB (7.38 million rows/s., 1.31 GB/s.)
```
The query latency decreased significantly because the nearest neighbours were retrieved using the vector index.
Vector similarity search using a vector similarity index may return results that differ sl... | {"source_file": "laion.md"} | [
-0.01088802982121706,
-0.0908539816737175,
-0.01838628575205803,
0.025070613250136375,
0.07087680697441101,
-0.009478495456278324,
-0.08165387064218521,
-0.0017540762200951576,
0.009156458079814911,
-0.037313416600227356,
0.01582431048154831,
0.011796493083238602,
0.06899683177471161,
0.01... |
e15c3d28-f8c3-43e0-b3ca-0f10b0602f7a | Note that the
encode_text()
UDF itself could require a few seconds to compute and emit the embedding vector.
Image embeddings {#image-embeddings}
Image embeddings can be created similarly and we provide a Python script that can generate an embedding of an image stored locally as a file.
encode_image.py
```pyt... | {"source_file": "laion.md"} | [
0.006199095398187637,
-0.07023455202579498,
-0.0911303460597992,
-0.007259007543325424,
0.06978198885917664,
-0.05707506090402603,
-0.032180625945329666,
0.021197177469730377,
-0.01509921532124281,
-0.06360428035259247,
0.04296047240495682,
-0.024751979857683182,
-0.04326861351728439,
0.03... |
cb77531a-9008-421d-914c-df401b78d2f1 | description: 'Dataset containing 28 million rows of hacker news data.'
sidebar_label: 'Hacker news'
slug: /getting-started/example-datasets/hacker-news
title: 'Hacker News dataset'
doc_type: 'guide'
keywords: ['example dataset', 'hacker news', 'sample data', 'text analysis', 'vector search']
Hacker News dataset
... | {"source_file": "hacker-news.md"} | [
0.004003259353339672,
0.005418583285063505,
-0.10739181190729141,
0.0005864157574251294,
0.0243636853992939,
-0.10444851964712143,
-0.031227268278598785,
-0.03792453557252884,
-0.008329039439558983,
0.09241097420454025,
0.06118685007095337,
0.0022397104185074568,
0.07053713500499725,
-0.12... |
e4aa1638-8cbd-4921-8968-aa02bbd0865a | Load the data with schema inference {#loading-the-data}
The simplest and most powerful tool for data loading is the
clickhouse-client
: a feature-rich native command-line client.
To load data, you can again exploit schema inference, relying on ClickHouse to determine the types of the columns.
Run the following com... | {"source_file": "hacker-news.md"} | [
0.025334550067782402,
-0.05521878972649574,
-0.0972219705581665,
0.08097325265407562,
-0.004874367266893387,
-0.0425741970539093,
-0.056211069226264954,
-0.0189412422478199,
0.004524108488112688,
0.0663929134607315,
0.02107652835547924,
-0.0469646193087101,
0.08770648390054703,
-0.08324839... |
9a635db2-8716-40b7-bab2-aa126fa093b6 | While schema inference is a great tool for initial data exploration, it is “best effort” and not a long-term substitute for defining an optimal schema for your data.
Define a schema {#define-a-schema}
An obvious immediate optimization is to define a type for each field.
In addition to declaring the time field as a... | {"source_file": "hacker-news.md"} | [
-0.006656309589743614,
0.002980608493089676,
0.04425283521413803,
0.06622186303138733,
-0.005561886355280876,
-0.016298094764351845,
0.034423213452100754,
-0.04796749725937843,
-0.032726116478443146,
0.018483176827430725,
0.008842035196721554,
-0.02662510797381401,
0.01993465982377529,
0.0... |
809bf756-0243-4fdc-a036-6f25257a2be4 | Row 3:
──────
time: 1465985177
score: 243
descendants: 70
title: ClickHouse – high-performance open-source distributed column-oriented DBMS
url: https://clickhouse.yandex/reference_en.html
hn_url: https://news.ycombinator.com/item?id=11908254
Row 4:
──────
time: 1578331410
score... | {"source_file": "hacker-news.md"} | [
-0.05259043723344803,
-0.08567401766777039,
-0.1250600516796112,
0.014677268452942371,
0.002687873551622033,
-0.07633010298013687,
-0.04562316834926605,
-0.0258503220975399,
-0.04742090404033661,
0.0629434660077095,
0.00035915672197006643,
0.020620495080947876,
0.010806509293615818,
-0.049... |
075c9904-d06d-4831-b828-32a15c002414 | response title="Response"
┌─monthYear─┬─bar(count(), 0, 120, 20)─┐
│ 201606 │ ██▎ │
│ 201607 │ ▏ │
│ 201610 │ ▎ │
│ 201612 │ ▏ │
│ 201701 │ ▎ │
│ 201702 │ █ │
│ 20... | {"source_file": "hacker-news.md"} | [
-0.010974260047078133,
0.0475260429084301,
-0.008508974686264992,
0.05349775031208992,
-0.055898867547512054,
-0.019346872344613075,
0.007626266684383154,
-0.03351190686225891,
0.03574484959244728,
0.04479402303695679,
0.04599659517407417,
-0.04040772467851639,
0.08438511192798615,
-0.0362... |
77a418d9-99a2-43fa-9f2c-98b6346f743f | It looks like "ClickHouse" is growing in popularity with time.
Who are the top commenters on ClickHouse related articles? {#top-commenters}
sql title="Query"
SELECT
by,
count() AS comments
FROM hackernews
WHERE (type IN ('story', 'comment')) AND ((title ILIKE '%ClickHouse%') OR (text ILIKE '%ClickHouse%'))
GR... | {"source_file": "hacker-news.md"} | [
-0.008002969436347485,
-0.06557104736566544,
0.030330264940857887,
0.12637606263160706,
0.015029257163405418,
-0.01622055657207966,
0.08591211587190628,
0.022067280486226082,
-0.0005395711632445455,
0.007931437343358994,
0.040655944496393204,
0.01873401179909706,
0.11695997416973114,
0.014... |
4d427240-6e15-4b52-8e27-5665cc286c7d | Run the following command to view the inferred schema:
sql title="Query"
┌─name────────┬─type───────────────────┬
│ id │ Nullable(Int64) │
│ deleted │ Nullable(UInt8) │
│ type │ Nullable(String) │
│ time │ Nullable(Int64) │
│ text │ Nullable(String) │... | {"source_file": "hacker-news.md"} | [
0.006147409789264202,
-0.052903883159160614,
-0.10528872907161713,
0.05177394300699234,
0.030218183994293213,
0.06513138860464096,
-0.004228841047734022,
-0.049266666173934937,
-0.034417349845170975,
0.06698734313249588,
0.041683148592710495,
-0.07461708039045334,
0.12304273247718811,
-0.0... |
56dce198-d79a-4f27-b04b-b5c8f8bf3b57 | Notice how the query now took only 0.248 seconds with the index, down from 0.843 seconds previously without it:
```response title="Response"
highlight-next-line
1 row in set. Elapsed: 0.248 sec. Processed 4.54 million rows, 1.79 GB (18.34 million rows/s., 7.24 GB/s.)
┌─count()─┐
│ 1145 │
└─────────┘
```
The ... | {"source_file": "hacker-news.md"} | [
0.0021336902864277363,
-0.010002686642110348,
0.05624351650476456,
0.11599326878786087,
0.07439335435628891,
-0.030891967937350273,
0.036291297525167465,
-0.007641918957233429,
0.07375528663396835,
0.04836171120405197,
0.027397500351071358,
0.014853413216769695,
0.0797998383641243,
-0.0885... |
a0280af4-fc00-4e7e-b9b4-0161fc5b11de | description: 'Dataset containing 28+ million Hacker News postings & their vector embeddings'
sidebar_label: 'Hacker News vector search dataset'
slug: /getting-started/example-datasets/hackernews-vector-search-dataset
title: 'Hacker News vector search dataset'
keywords: ['semantic search', 'vector similarity', 'approxim... | {"source_file": "hacker-news-vector-search.md"} | [
-0.00227040471509099,
-0.05396965518593788,
-0.05364293232560158,
0.013772737234830856,
0.04868926480412483,
0.028796719387173653,
-0.06740519404411316,
0.02215750142931938,
-0.007612308487296104,
-0.006933924742043018,
0.011992019601166248,
0.03564263880252838,
0.12865282595157623,
-0.040... |
65fffc9c-b377-4dd4-8704-89e1abab3b1a | ALTER TABLE hackernews MATERIALIZE INDEX vector_index SETTINGS mutations_sync = 2;
```
The parameters and performance considerations for index creation and search are described in the
documentation
.
The statement above uses values of 64 and 512 respectively for the HNSW hyperparameters
M
and
ef_construction
.
Us... | {"source_file": "hacker-news-vector-search.md"} | [
-0.017440438270568848,
0.019427688792347908,
-0.02939150296151638,
0.08178257197141647,
0.007693817839026451,
-0.01411439012736082,
-0.008710401132702827,
-0.02363540232181549,
-0.06191650778055191,
-0.006792856380343437,
-0.016127433627843857,
-0.0022286090534180403,
0.07827254384756088,
... |
a8d2092c-a2fd-4510-a3bc-98dd62a4d811 | Querying ClickHouse...
Results :
27742647 smartmic:
slt2021: OLAP Cube is not dead, as long as you use some form of:
1. GROUP BY multiple fi
27744260 georgewfraser:A data mart is a logical organization of data to help humans understand the schema. Wh
27761434 mwexler:"We model data according to rigorous frame... | {"source_file": "hacker-news-vector-search.md"} | [
-0.06909271329641342,
-0.04451845586299896,
-0.02465173974633217,
0.12750427424907684,
0.05162839964032173,
-0.11287996917963028,
-0.054015059024095535,
0.01122419536113739,
-0.0008807161939330399,
-0.010896717198193073,
0.011134332045912743,
-0.00980392936617136,
0.03431185707449913,
-0.0... |
ec2b4d1b-4ab4-4f70-8ce4-7cc415b1e77d | Retrieves highly relevant posts/comments using vector similarity search on the
hackernews
table
Uses
LangChain
and OpenAI
gpt-3.5-turbo
Chat API to
summarize
the content retrieved in step #3.
The posts/comments retrieved in step #3 are passed as
context
to the Chat API and are the key link in Generative ... | {"source_file": "hacker-news-vector-search.md"} | [
-0.0926138237118721,
-0.04214294254779816,
-0.07580195367336273,
0.04639441892504692,
0.05583744868636131,
-0.02706369198858738,
0.017687804996967316,
0.0120767280459404,
0.055444370955228806,
-0.0660993829369545,
-0.017683910205960274,
0.0002985487808473408,
0.0943959504365921,
0.00981200... |
c5953984-ddbc-46c9-b9aa-3216aba79381 | model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')
chclient = clickhouse_connect.get_client(compress=False) # ClickHouse credentials here
while True:
# Take the search query from user
print("Enter a search topic :")
input_query = sys.stdin.readline();
texts = [input_query]
# Run... | {"source_file": "hacker-news-vector-search.md"} | [
-0.0028884545899927616,
0.03826155513525009,
-0.03859945386648178,
0.07775871455669403,
-0.05897403135895729,
0.0857841894030571,
-0.016732413321733475,
0.06916852295398712,
-0.00887133926153183,
-0.08216960728168488,
-0.004925994202494621,
-0.06039449945092201,
0.15456999838352203,
-0.045... |
95470bd5-40d8-4e18-ad7d-ecb4971be886 | description: 'The Star Schema Benchmark (SSB) data set and queries'
sidebar_label: 'Star Schema Benchmark'
slug: /getting-started/example-datasets/star-schema
title: 'Star Schema Benchmark (SSB, 2009)'
doc_type: 'guide'
keywords: ['example dataset', 'star schema', 'sample data', 'data modeling', 'benchmark']
The St... | {"source_file": "star-schema.md"} | [
0.0030315823387354612,
0.020285600796341896,
-0.02582036517560482,
0.06305564194917679,
-0.001341316499747336,
-0.034200266003608704,
-0.03549743443727493,
-0.013636743649840355,
-0.03020283579826355,
0.011490917764604092,
-0.020713090896606445,
-0.04158184677362442,
0.026152439415454865,
... |
a3e31ea8-5b0a-4f1d-b436-fb8a10cf68e7 | CREATE TABLE supplier
(
S_SUPPKEY UInt32,
S_NAME String,
S_ADDRESS String,
S_CITY LowCardinality(String),
S_NATION LowCardinality(String),
S_REGION LowCardinality(String),
S_PHONE String
)
ENGINE = MergeTree ORDE... | {"source_file": "star-schema.md"} | [
0.05243537202477455,
0.055744726210832596,
0.07115582376718521,
-0.0009759132517501712,
-0.12934458255767822,
0.0064004091545939445,
-0.04628723859786987,
0.04332845285534859,
-0.07335396856069565,
0.023184843361377716,
0.09927255660295486,
-0.05753237009048462,
-0.0013970390427857637,
-0.... |
bd8ecec4-be44-440d-9823-100134a481f3 | ```sql
SET max_memory_usage = 20000000000;
CREATE TABLE lineorder_flat
ENGINE = MergeTree ORDER BY (LO_ORDERDATE, LO_ORDERKEY)
AS SELECT
l.LO_ORDERKEY AS LO_ORDERKEY,
l.LO_LINENUMBER AS LO_LINENUMBER,
l.LO_CUSTKEY AS LO_CUSTKEY,
l.LO_PARTKEY AS LO_PARTKEY,
l.LO_SUPPKEY AS LO_SUPPKEY,
l.LO_ORDE... | {"source_file": "star-schema.md"} | [
0.04298517480492592,
0.0008757627801969647,
-0.005644753109663725,
0.06070650741457939,
-0.1284649670124054,
0.006160304881632328,
-0.02289152704179287,
0.09536637365818024,
-0.06481987982988358,
0.07114927470684052,
0.07136894017457962,
-0.017921168357133865,
0.029746482148766518,
-0.0884... |
3d1897f8-4140-4612-9efb-075976090d7f | Denormalized table:
sql
SELECT
sum(LO_EXTENDEDPRICE * LO_DISCOUNT) AS revenue
FROM
lineorder_flat
WHERE
toISOWeek(LO_ORDERDATE) = 6
AND toYear(LO_ORDERDATE) = 1994
AND LO_DISCOUNT BETWEEN 5 AND 7
AND LO_QUANTITY BETWEEN 26 AND 35;
Q2.1
sql
SELECT
sum(LO_REVENUE),
D_YEAR,
P_BRAN... | {"source_file": "star-schema.md"} | [
0.06390402466058731,
-0.007998386397957802,
0.06808371841907501,
0.021528882905840874,
-0.082834891974926,
0.05038246139883995,
-0.008927464485168457,
0.04671308025717735,
-0.056201547384262085,
-0.021999968215823174,
0.05350204184651375,
-0.057462453842163086,
-0.0200493261218071,
-0.0586... |
4d309921-e06d-481f-8827-4638b96403fc | Q3.2
sql
SELECT
C_CITY,
S_CITY,
D_YEAR,
sum(LO_REVENUE) AS REVENUE
FROM
customer,
lineorder,
supplier,
date
WHERE
LO_CUSTKEY = C_CUSTKEY
AND LO_SUPPKEY = S_SUPPKEY
AND LO_ORDERDATE = D_DATEKEY
AND C_NATION = 'UNITED STATES'
AND S_NATION = 'UNITED STATES'
AND D_Y... | {"source_file": "star-schema.md"} | [
0.04196598753333092,
-0.029587654396891594,
0.04394057020545006,
0.03567129373550415,
-0.1196785420179367,
0.04046822339296341,
-0.003388779703527689,
-0.02040752023458481,
-0.05340857058763504,
-0.02275337651371956,
0.06344049423933029,
-0.10770635306835175,
0.017160631716251373,
-0.01963... |
4e37fd5c-c2ae-4038-873a-6d21332075ec | Denormalized table:
sql
SELECT
toYear(LO_ORDERDATE) AS year,
C_NATION,
sum(LO_REVENUE - LO_SUPPLYCOST) AS profit
FROM lineorder_flat
WHERE C_REGION = 'AMERICA' AND S_REGION = 'AMERICA' AND (P_MFGR = 'MFGR#1' OR P_MFGR = 'MFGR#2')
GROUP BY
year,
C_NATION
ORDER BY
year ASC,
C_NATION ASC;
Q... | {"source_file": "star-schema.md"} | [
0.07326330989599228,
-0.004423067905008793,
0.04091827571392059,
0.054736293852329254,
-0.11026713252067566,
0.04297230392694473,
-0.02085988037288189,
0.001802070764824748,
-0.045621227473020554,
-0.05326760932803154,
0.0217802245169878,
-0.09721684455871582,
-0.004988525994122028,
-0.008... |
e1838278-61dd-4f37-9a13-3ed56d3983b4 | description: 'Learn how to use projections to improve the performance of queries that
you run frequently using the UK property dataset, which contains data about prices
paid for real-estate property in England and Wales'
sidebar_label: 'UK property prices'
slug: /getting-started/example-datasets/uk-price-paid
title... | {"source_file": "uk-price-paid.md"} | [
0.03313375636935234,
-0.026375018060207367,
-0.03400157019495964,
0.06635996699333191,
-0.041780032217502594,
-0.01761162467300892,
-0.05414887145161629,
-0.02201998606324196,
-0.05044969171285629,
0.06831929087638855,
-0.018475381657481194,
-0.04966690391302109,
0.0467977337539196,
-0.020... |
a54e50d8-5bce-4cbe-8b18-50472707761c | The
url
function streams the data from the web server into your ClickHouse table. The following command inserts 5 million rows into the
uk_price_paid
table:
sql
INSERT INTO uk.uk_price_paid
SELECT
toUInt32(price_string) AS price,
parseDateTimeBestEffortUS(time) AS date,
splitByChar(' ', postcode)[1] A... | {"source_file": "uk-price-paid.md"} | [
0.03851724788546562,
-0.06705735623836517,
-0.0322934091091156,
0.04370522126555443,
-0.05778971686959267,
-0.09267838299274445,
-0.037414681166410446,
-0.06488794088363647,
-0.09811774641275406,
0.04056483134627342,
0.04978606104850769,
-0.1021038368344307,
0.04313395544886589,
-0.0974284... |
b3c3e12e-dbcd-407f-b8f3-935d4b21f175 | description: 'Dataset containing 1 million articles from Wikipedia and their vector embeddings'
sidebar_label: 'dbpedia dataset'
slug: /getting-started/example-datasets/dbpedia-dataset
title: 'dbpedia dataset'
keywords: ['semantic search', 'vector similarity', 'approximate nearest neighbours', 'embeddings']
doc_type: '... | {"source_file": "dbpedia.md"} | [
-0.04481258988380432,
-0.07038255035877228,
-0.032942675054073334,
-0.009305226616561413,
0.0493253618478775,
0.030111370608210564,
-0.02584431692957878,
-0.009131822735071182,
-0.004781630355864763,
-0.009640083648264408,
0.02234290912747383,
-0.005433323327451944,
0.1262395828962326,
0.0... |
2ece3677-1441-4ef4-a0fb-048eeab59300 | ```sql
SELECT count(*)
FROM dbpedia
┌─count()─┐
1. │ 1000000 │
└─────────┘
```
Semantic search {#semantic-search}
Recommended reading:
"Vector embeddings
" OpenAPI guide
Semantic search (also referred to as
similarity search
) using vector embeddings involves
the following steps:
Accept a search query ... | {"source_file": "dbpedia.md"} | [
0.05397402122616768,
-0.0824027881026268,
-0.01701466366648674,
0.0479494072496891,
0.0592338889837265,
0.024836966767907143,
0.016025466844439507,
0.0030953409150242805,
0.0035412649158388376,
-0.033456020057201385,
-0.00925415102392435,
-0.06747353076934814,
0.13025324046611786,
-0.00604... |
439a3f15-6a2d-4288-b761-9dfe9d98829b | highlight-next-line
20 rows in set. Elapsed: 0.261 sec. Processed 1.00 million rows, 6.22 GB (3.84 million rows/s., 23.81 GB/s.)
```
Note down the query latency so that we can compare it with the query latency of ANN (using vector index).
Also record the query latency with cold OS file cache and with
max_threads=1... | {"source_file": "dbpedia.md"} | [
-0.0034374259412288666,
-0.016843967139720917,
-0.1114412471652031,
0.016297701746225357,
0.023446187376976013,
-0.06073162332177162,
-0.02051026187837124,
-0.030245138332247734,
-0.07047399133443832,
0.0019444625359028578,
-0.015327638015151024,
-0.02816247008740902,
0.014079802669584751,
... |
76b696ee-6490-4804-b10b-17102c824c4e | ```response title="Response"
┌─id──────────────────────────────────────────────┬─title─────────────────────────────────┐
1. │
│ Glacier Express │
2. │
│ BVZ Zermatt-Bahn │
3. │
│ Gornergrat railway ... | {"source_file": "dbpedia.md"} | [
-0.06886451691389084,
-0.04823829606175423,
0.03815218061208725,
0.06709544360637665,
0.02668391726911068,
0.0010991113958880305,
-0.05806450545787811,
0.049915678799152374,
-0.07311611622571945,
-0.020300421863794327,
-0.016343912109732628,
-0.06552651524543762,
-0.007815846242010593,
-0.... |
bafa50ce-5e9b-44e6-8e1a-1c756e928c0c | ch_client = clickhouse_connect.get_client(compress=False) # Pass ClickHouse credentials
openai_client = OpenAI() # Set OPENAI_API_KEY environment variable
def get_embedding(text, model):
text = text.replace("\n", " ")
return openai_client.embeddings.create(input = [text], model=model, dimensions=1536).data[0].emb... | {"source_file": "dbpedia.md"} | [
0.025737326592206955,
-0.0037073995918035507,
-0.05791925638914108,
0.06984211504459381,
-0.002958551049232483,
0.013728110119700432,
-0.025747383013367653,
0.03710304945707321,
0.01964101754128933,
-0.10915970057249069,
0.006562735419720411,
-0.026860186830163002,
0.09701130539178848,
-0.... |
15e411a9-821e-4793-ae49-5cc3b8e80408 | $
```
Code:
```Python
import sys
import time
from openai import OpenAI
import clickhouse_connect
ch_client = clickhouse_connect.get_client(compress=False) # Pass ClickHouse credentials here
openai_client = OpenAI() # Set the OPENAI_API_KEY environment variable
def get_embedding(text, model):
text = text.repla... | {"source_file": "dbpedia.md"} | [
0.041053205728530884,
-0.015570898540318012,
-0.08719760924577713,
0.07208890467882156,
0.0028182300738990307,
0.025007860735058784,
0.01962835155427456,
0.018182294443249702,
0.05080375820398331,
-0.07713126391172409,
0.013802139088511467,
0.002886541187763214,
0.12093529850244522,
0.0124... |
87c04701-6b66-4e1a-8223-b2def98e5533 | description: 'Dataset containing the on-time performance of airline flights'
sidebar_label: 'OnTime airline flight data'
slug: /getting-started/example-datasets/ontime
title: 'OnTime'
doc_type: 'guide'
keywords: ['example dataset', 'flight data', 'sample data', 'airline performance', 'benchmark']
This dataset conta... | {"source_file": "ontime.md"} | [
0.04396050050854683,
-0.010388280265033245,
-0.09390851110219955,
0.08629070967435837,
0.01565081626176834,
-0.008321316912770271,
0.03729613870382309,
0.03430762141942978,
-0.06649700552225113,
0.02380412630736828,
0.05435754731297493,
-0.025011718273162842,
-0.03347751125693321,
0.005657... |
75836dc9-9691-4e41-af67-0cdd05ede7f1 | sql
CREATE TABLE `ontime`
(
`Year` UInt16,
`Quarter` UInt8,
`Month` UInt8,
`DayofMonth` UInt8,
`DayOfWeek` UInt8,
`FlightDate` Date,
`Reporting_Airline... | {"source_file": "ontime.md"} | [
0.1198309138417244,
0.014530378393828869,
-0.02923651970922947,
0.0781666710972786,
-0.060599491000175476,
-0.007724286522716284,
0.05992336571216583,
0.05464540049433708,
-0.04390936344861984,
0.028384564444422722,
0.04635295271873474,
-0.11072061210870743,
-0.01649552769958973,
0.0068174... |
a5f11a7b-e302-430d-9f64-113b5ce5dfb4 | `DistanceGroup` Int8,
`CarrierDelay` Int32,
`WeatherDelay` Int32,
`NASDelay` Int32,
`SecurityDelay` Int32,
`LateAircraftDelay` Int32,
`FirstDepTime` Int16,
`Total... | {"source_file": "ontime.md"} | [
0.024920547381043434,
0.03738716244697571,
-0.06944822520017624,
-0.06416360288858414,
-0.024620018899440765,
-0.045069627463817596,
0.03543062135577202,
0.056384824216365814,
-0.04637798294425011,
-0.058990154415369034,
0.06944770365953445,
-0.07127079367637634,
0.05910465493798256,
-0.00... |
4abc498f-8cbc-4beb-8a39-7580b0dcc8c5 | Import from raw data {#import-from-raw-data}
Downloading data:
bash
wget --no-check-certificate --continue https://transtats.bts.gov/PREZIP/On_Time_Reporting_Carrier_On_Time_Performance_1987_present_{1987..2022}_{1..12}.zip
Loading data with multiple threads:
bash
ls -1 *.zip | xargs -I{} -P $(nproc) bash -c "e... | {"source_file": "ontime.md"} | [
-0.03935223072767258,
0.03288319706916809,
-0.12290555983781815,
0.08750001341104507,
0.0320359505712986,
-0.02645929530262947,
-0.01812565326690674,
-0.014126164838671684,
0.0019513109000399709,
0.028283435851335526,
0.018246471881866455,
-0.05028550699353218,
0.08594519644975662,
-0.0840... |
7d0db5eb-f4ab-41b3-bf1d-1027223d17d6 | Better version of the same query:
sql
SELECT IATA_CODE_Reporting_Airline AS Carrier, avg(DepDelay>10)*100 AS c3
FROM ontime
WHERE Year>=2000 AND Year<=2008
GROUP BY Carrier
ORDER BY c3 DESC;
Q7. Percentage of flights delayed for more than 10 minutes, by year
sql
SELECT Year, c1/c2
FROM
(
SELECT
Year,
... | {"source_file": "ontime.md"} | [
0.11119335889816284,
-0.046784937381744385,
-0.009427799843251705,
0.09920668601989746,
-0.04440326616168022,
0.0384678989648819,
0.07258492708206177,
0.025650106370449066,
-0.0034428176004439592,
0.031138669699430466,
0.07397856563329697,
-0.10686006397008896,
-0.021298298612236977,
0.046... |
91a49340-c999-4e57-b162-d7fa6802c44f | description: '131 million rows of weather observation data for the last 128 yrs'
sidebar_label: 'Taiwan historical weather datasets'
slug: /getting-started/example-datasets/tw-weather
title: 'Taiwan historical weather datasets'
doc_type: 'guide'
keywords: ['example dataset', 'weather', 'taiwan', 'sample data', 'climate... | {"source_file": "tw-weather.md"} | [
-0.03911858797073364,
0.025860359892249107,
0.012469795532524586,
0.030130207538604736,
0.011297444812953472,
-0.027675561606884003,
-0.029754074290394783,
-0.004452452529221773,
-0.0648382157087326,
-0.012293734587728977,
0.039795778691768646,
-0.09981857985258102,
0.040555234998464584,
-... |
5d11c59a-85e7-4d75-940f-de808b1d61a6 | Option: Validate the checksum
md5sum preprocessed_weather_daily_1896_2023.tar.gz
Checksum should be equal to: 11b484f5bd9ddafec5cfb131eb2dd008
tar -xzvf preprocessed_weather_daily_1896_2023.tar.gz
daily_weather_preprocessed_1896_2023.csv
Option: Validate the checksum
md5sum daily_weather_preprocessed_1896_202... | {"source_file": "tw-weather.md"} | [
-0.050431448966264725,
0.09957946836948395,
-0.03858083486557007,
-0.05684182047843933,
0.11678753793239594,
-0.10779844224452972,
-0.0009334846981801093,
-0.04100888594985008,
-0.06430044770240784,
0.05997123941779137,
-0.018385840579867363,
-0.07751288264989853,
0.016927821561694145,
-0.... |
f9ae65df-b49f-4655-aaf4-1b14bf73bbc2 | where
/path/to
represents the specific user path to the local file on the disk.
And the sample response output is as follows after inserting data into the ClickHouse:
```response
Query id: 90e4b524-6e14-4855-817c-7e6f98fbeabb
Ok.
131985329 rows in set. Elapsed: 71.770 sec. Processed 131.99 million rows, 10.06 G... | {"source_file": "tw-weather.md"} | [
0.019654307514429092,
0.03345165029168129,
-0.03339537978172302,
0.07750806957483292,
-0.011082208715379238,
-0.16387556493282318,
-0.023542769253253937,
-0.02406959980726242,
0.0005598643911071122,
0.05460483208298683,
-0.0016337836859747767,
-0.01708882860839367,
0.0422494113445282,
-0.1... |
f4204b8b-f7f2-4c79-9ce8-04c4ed34c2a6 | Q2: Raw data fetching with the specific duration time range, fields and weather station {#q2-raw-data-fetching-with-the-specific-duration-time-range-fields-and-weather-station}
sql
SELECT
StnPres,
SeaPres,
Tx,
Td,
RH,
WS,
WD,
WSGust,
WDGust,
Precp,
PrecpHour
FROM tw_weather... | {"source_file": "tw-weather.md"} | [
-0.00748435640707612,
0.01880768872797489,
0.07433842867612839,
0.07745610177516937,
-0.042440131306648254,
0.011460709385573864,
-0.007911402732133865,
0.011647881008684635,
-0.0026932116597890854,
0.04640372842550278,
0.006649756338447332,
-0.07678878307342529,
-0.027757203206419945,
-0.... |
71bb7479-cb22-414c-bbfc-0d0db94b353c | description: 'Ingest and query Tab Separated Value data in 5 steps'
sidebar_label: 'NYPD complaint data'
slug: /getting-started/example-datasets/nypd_complaint_data
title: 'NYPD Complaint Data'
doc_type: 'guide'
keywords: ['example dataset', 'nypd', 'crime data', 'sample data', 'public data']
Tab separated value, o... | {"source_file": "nypd_complaint_data.md"} | [
0.027127573266625404,
0.02548246644437313,
-0.06688456237316132,
0.05005655810236931,
-0.002546544885262847,
0.034828975796699524,
0.04534688964486122,
0.06171022728085518,
-0.08803253620862961,
-0.001865824800916016,
0.04125264286994934,
-0.011444303207099438,
0.02845950983464718,
-0.0096... |
28201ba6-0d77-462e-863d-b1dd4212a0b5 | :::tip
Most of the time the above command will let you know which fields in the input data are numeric, and which are strings, and which are tuples. This is not always the case. Because ClickHouse is routineley used with datasets containing billions of records there is a default number (100) of rows examined to
infe... | {"source_file": "nypd_complaint_data.md"} | [
0.07387964427471161,
-0.03233640640974045,
-0.05258765444159508,
-0.0042243413627147675,
-0.012009863741695881,
0.0018459075363352895,
-0.009526138193905354,
-0.026889096945524216,
-0.07509847730398178,
0.03622747212648392,
0.054905228316783905,
-0.0905100479722023,
-0.010490108281373978,
... |
2afe2c9b-be6a-4a55-be2d-b5419d2aee49 | At this point you should check that the columns in the TSV file match the names and types specified in the
Columns in this Dataset
section of the
dataset web page
. The data types are not very specific, all numeric fields are set to
Nullable(Float64)
, and all other fields are
Nullable(String)
. When you create ... | {"source_file": "nypd_complaint_data.md"} | [
0.07952296733856201,
-0.03672267869114876,
-0.029418431222438812,
0.008233627304434776,
-0.07585098594427109,
0.01663121022284031,
0.0012466865591704845,
-0.018348248675465584,
-0.11722336709499359,
0.06937308609485626,
0.07209720462560654,
-0.07478391379117966,
0.007907697930932045,
-0.02... |
68e83994-d19e-44da-a78d-30e0a79eadc1 | Result:
response
┌─PARKS_NM───────────────────┐
│ (null) │
│ ASSER LEVY PARK │
│ JAMES J WALKER PARK │
│ BELT PARKWAY/SHORE PARKWAY │
│ PROSPECT PARK │
│ MONTEFIORE SQUARE │
│ SUTTON PLACE PARK │
│ JOYCE KILMER PARK │
│ ALLEY ATHLETIC PLAYGR... | {"source_file": "nypd_complaint_data.md"} | [
0.07521393895149231,
-0.01576595939695835,
0.06965617090463638,
0.03631313517689705,
0.048041872680187225,
0.02457381784915924,
0.006659934297204018,
0.01911168359220028,
0.01477119605988264,
-0.025361593812704086,
0.024088306352496147,
-0.07848095893859863,
-0.0383729413151741,
-0.0398649... |
711671c8-a6bc-4f54-840b-2b56d53400e4 | Make a plan {#make-a-plan}
Based on the above investigation:
-
JURISDICTION_CODE
should be cast as
UInt8
.
-
PARKS_NM
should be cast to
LowCardinality(String)
-
CMPLNT_FR_DT
and
CMPLNT_FR_TM
are always populated (possibly with a default time of
00:00:00
)
-
CMPLNT_TO_DT
and
CMPLNT_TO_TM
may be empty
-... | {"source_file": "nypd_complaint_data.md"} | [
0.061398960649967194,
0.09787234663963318,
-0.028362249955534935,
-0.05394556745886803,
-0.03896867856383324,
0.007894148118793964,
-0.06477032601833344,
0.05581085756421089,
-0.09372308850288391,
0.0235341414809227,
-0.02657892182469368,
-0.10811261087656021,
-0.029053540900349617,
-0.012... |
2c63664c-cb9c-4d96-b66b-ac21539228a1 | Lines 2 and 3 above contain the concatenation from the previous step, and lines 4 and 5 above parse the strings into
DateTime64
. As the complaint end time is not guaranteed to exist
parseDateTime64BestEffortOrNull
is used.
Result:
response
┌─────────complaint_begin─┬───────────complaint_end─┐
│ 1925-01-01 10:00... | {"source_file": "nypd_complaint_data.md"} | [
-0.04031868278980255,
0.07563973218202591,
0.054791271686553955,
0.014591529034078121,
-0.002658543176949024,
-0.026917865499854088,
-0.041940730065107346,
0.009751406498253345,
0.018617572262883186,
0.019912071526050568,
0.0747920572757721,
-0.05668704956769943,
0.004429289605468512,
-0.0... |
32401ac1-fd0a-4fba-a1ba-486ac5d44867 | If only
ORDER BY
is specified, then the same tuple will be used as
PRIMARY KEY
The primary key index is created using the
PRIMARY KEY
tuple if specified, otherwise the
ORDER BY
tuple
The
PRIMARY KEY
index is kept in main memory
Looking at the dataset and the questions that might be answered by querying... | {"source_file": "nypd_complaint_data.md"} | [
0.028936538845300674,
-0.003961690701544285,
-0.0339096337556839,
-0.05566379055380821,
0.0320371575653553,
0.04785580560564995,
0.040262721478939056,
0.0055510480888187885,
0.016047213226556778,
0.08763725310564041,
0.07829984277486801,
0.09011159837245941,
0.039100874215364456,
-0.089760... |
3ecd915a-6969-4651-821f-d0f02ad4c166 | sql
ORDER BY ( borough, offense_description, date_reported )
:::
Putting together the changes to data types and the
ORDER BY
tuple gives this table structure:
sql
CREATE TABLE NYPD_Complaint (
complaint_number String,
precinct UInt8,
borough LowCardinality(String),
co... | {"source_file": "nypd_complaint_data.md"} | [
0.08557862043380737,
-0.0324089489877224,
0.03574318811297417,
-0.001483598374761641,
-0.027094600722193718,
0.016796806827187538,
0.007460818160325289,
0.00610559294000268,
-0.08852682262659073,
0.08730673789978027,
0.11247014254331589,
-0.005447846371680498,
0.014341368339955807,
-0.0402... |
f700d40f-2398-4451-8a0f-69b3a0c873ef | We will use
clickhouse-local
tool for data preprocessing and
clickhouse-client
to upload it.
clickhouse-local
arguments used {#clickhouse-local-arguments-used}
:::tip
table='input'
appears in the arguments to clickhouse-local below. clickhouse-local takes the provided input (
cat ${HOME}/NYPD_Complaint_Data... | {"source_file": "nypd_complaint_data.md"} | [
0.015029003843665123,
-0.021961959078907967,
-0.043068259954452515,
0.03224882483482361,
-0.00028708731406368315,
0.0013039764016866684,
0.015640556812286377,
0.004763512406498194,
-0.08915023505687714,
0.05434351786971092,
0.044679466634988785,
-0.01729954220354557,
0.037675559520721436,
... |
9ebc9e5c-6070-4bbd-8356-e3525d722608 | sql
cat ${HOME}/NYPD_Complaint_Data_Current__Year_To_Date_.tsv \
| clickhouse-local --table='input' --input-format='TSVWithNames' \
--input_format_max_rows_to_read_for_schema_inference=2000 \
--query "
WITH (CMPLNT_FR_DT || ' ' || CMPLNT_FR_TM) AS CMPLNT_START,
(CMPLNT_TO_DT || ' ' || CMPLNT_TO_TM) AS CM... | {"source_file": "nypd_complaint_data.md"} | [
0.10654733330011368,
-0.039788879454135895,
-0.005871368572115898,
0.03956298902630806,
-0.036755163222551346,
0.02438380941748619,
-0.0024783669505268335,
0.06402114778757095,
-0.11975692957639694,
0.1090444028377533,
0.0835350900888443,
-0.11310610920190811,
0.0009759668027982116,
-0.047... |
83dc7f03-dbbb-42f8-b5f6-5011f23ca1a7 | Query:
sql
SELECT formatReadableSize(total_bytes)
FROM system.tables
WHERE name = 'NYPD_Complaint'
Result:
text
┌─formatReadableSize(total_bytes)─┐
│ 8.63 MiB │
└─────────────────────────────────┘
Run some queries {#run-queries}
Query 1. Compare the number of complaints by month {#query-... | {"source_file": "nypd_complaint_data.md"} | [
0.04108757525682449,
-0.03609525412321091,
-0.041755013167858124,
0.11650273203849792,
-0.07896357029676437,
-0.027080686762928963,
0.02859528921544552,
0.050829239189624786,
-0.04481438547372818,
0.05529511347413063,
0.025654403492808342,
-0.005053660832345486,
0.043851230293512344,
-0.05... |
f634bd86-5348-4944-96ba-d40da3883dc1 | 6 rows in set. Elapsed: 0.008 sec. Processed 208.99 thousand rows, 209.43 KB (27.14 million rows/s., 27.20 MB/s.)
```
Next steps {#next-steps}
A Practical Introduction to Sparse Primary Indexes in ClickHouse
discusses the differences in ClickHouse indexing compared to traditional relational databases, how ClickHou... | {"source_file": "nypd_complaint_data.md"} | [
-0.0016501813661307096,
-0.021062767133116722,
-0.06311820447444916,
0.0019614112097769976,
-0.055486466735601425,
-0.06903615593910217,
-0.026816541329026222,
-0.02220340631902218,
0.00030496210092678666,
0.0039020716212689877,
-0.0067054508253932,
0.059342190623283386,
0.011705073527991772... |
0fd52903-8d68-4205-b631-60acb4c75365 | description: 'The TPC-H benchmark data set and queries.'
sidebar_label: 'TPC-H'
slug: /getting-started/example-datasets/tpch
title: 'TPC-H (1999)'
doc_type: 'guide'
keywords: ['example dataset', 'tpch', 'benchmark', 'sample data', 'performance testing']
A popular benchmark which models the internal data warehouse o... | {"source_file": "tpch.md"} | [
-0.038450609892606735,
0.023676833137869835,
-0.023995859548449516,
0.047085072845220566,
-0.006485002115368843,
-0.0861130803823471,
-0.02402508072555065,
0.04028608649969101,
-0.03352779522538185,
-0.02445114217698574,
0.010640813037753105,
-0.018472721800208092,
0.005328332539647818,
-0... |
e8c4b93d-86cb-4fd0-a150-466ee892f143 | (Compressed sizes in ClickHouse are taken from
system.tables.total_bytes
and based on below table definitions.)
Now create tables in ClickHouse.
We stick as closely as possible to the rules of the TPC-H specification:
- Primary keys are created only for the columns mentioned in section 1.4.2.2 of the specificatio... | {"source_file": "tpch.md"} | [
0.004792928695678711,
-0.01688285358250141,
-0.054498717188835144,
0.017107542604207993,
-0.06425473093986511,
-0.047692663967609406,
0.044633299112319946,
-0.010094687342643738,
-0.06223031133413315,
0.023759083822369576,
0.01680004596710205,
-0.03705354407429695,
0.06989103555679321,
-0.... |
82e28afb-0c7f-4b14-8f6e-b3176ea054e6 | CREATE TABLE lineitem (
l_orderkey Int32,
l_partkey Int32,
l_suppkey Int32,
l_linenumber Int32,
l_quantity Decimal(15,2),
l_extendedprice Decimal(15,2),
l_discount Decimal(15,2),
l_tax Decimal(15,2),
l_returnflag String,
l_lines... | {"source_file": "tpch.md"} | [
0.01082843728363514,
0.038666948676109314,
-0.046256281435489655,
-0.02712620422244072,
-0.037147555500268936,
0.022122705355286598,
-0.0047926525585353374,
0.044805869460105896,
-0.04464856907725334,
0.07766629010438919,
0.0700266882777214,
-0.08975730836391449,
0.00677818339318037,
-0.05... |
e37b9c0f-9b63-4e89-b177-8000fb6eaa99 | ```sql
-- Scaling factor 1
INSERT INTO nation SELECT * FROM s3('https://clickhouse-datasets.s3.amazonaws.com/h/1/nation.tbl', NOSIGN, CSV) SETTINGS format_csv_delimiter = '|', input_format_defaults_for_omitted_fields = 1, input_format_csv_empty_as_default = 1;
INSERT INTO region SELECT * FROM s3('https://clickhouse-dat... | {"source_file": "tpch.md"} | [
0.062402427196502686,
-0.005217408295720816,
-0.06328154355287552,
0.03220656141638756,
0.05134862661361694,
0.005528301000595093,
-0.07291564345359802,
-0.06694798916578293,
-0.003937759902328253,
-0.006077487021684647,
0.03542609140276909,
-0.09888162463903427,
0.05926118791103363,
-0.10... |
7948c77e-114d-4702-842e-29a9d7383161 | -- Scaling factor 100
INSERT INTO nation SELECT * FROM s3('https://clickhouse-datasets.s3.amazonaws.com/h/100/nation.tbl.gz', NOSIGN, CSV) SETTINGS format_csv_delimiter = '|', input_format_defaults_for_omitted_fields = 1, input_format_csv_empty_as_default = 1;
INSERT INTO region SELECT * FROM s3('https://clickhouse-dat... | {"source_file": "tpch.md"} | [
0.06192854046821594,
0.012879564426839352,
-0.054224371910095215,
-0.0013162520481273532,
0.05990635231137276,
0.006002479698508978,
-0.06864380091428757,
-0.06649895012378693,
-0.014892050996422768,
0.010609031654894352,
0.03497421368956566,
-0.10069629549980164,
0.05430033430457115,
-0.0... |
08330727-4721-4e6f-ad5f-e1750bfe0174 | Q1
sql
SELECT
l_returnflag,
l_linestatus,
sum(l_quantity) AS sum_qty,
sum(l_extendedprice) AS sum_base_price,
sum(l_extendedprice * (1 - l_discount)) AS sum_disc_price,
sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge,
avg(l_quantity) AS avg_qty,
avg(l_extendedprice)... | {"source_file": "tpch.md"} | [
0.022662056609988213,
0.019026555120944977,
0.027455978095531464,
0.09603064507246017,
-0.09031089395284653,
0.0350167416036129,
0.040536701679229736,
0.07030709087848663,
-0.011425334960222244,
0.0013529392890632153,
0.12385080754756927,
-0.07872532308101654,
0.06776956468820572,
-0.06429... |
185e3f8f-2327-430f-a697-4c342bf6f246 | Q6
sql
SELECT
sum(l_extendedprice * l_discount) AS revenue
FROM
lineitem
WHERE
l_shipdate >= DATE '1994-01-01'
AND l_shipdate < DATE '1994-01-01' + INTERVAL '1' year
AND l_discount BETWEEN 0.06 - 0.01 AND 0.06 + 0.01
AND l_quantity < 24;
::::note
As of February 2025, the query does not work ... | {"source_file": "tpch.md"} | [
-0.029026541858911514,
0.005299244541674852,
0.030519383028149605,
0.0401700995862484,
-0.0678105503320694,
0.0447077676653862,
-0.006503366399556398,
0.04511905089020729,
-0.01735987886786461,
0.01336262933909893,
0.06132085621356964,
-0.1133216917514801,
-0.03392418846487999,
-0.01457948... |
42f25b47-8f83-4650-bb7e-a2f2a69b6777 | Q9
sql
SELECT
nation,
o_year,
sum(amount) AS sum_profit
FROM (
SELECT
n_name AS nation,
extract(year FROM o_orderdate) AS o_year,
l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity AS amount
FROM
part,
supplier,
lineitem,
partsup... | {"source_file": "tpch.md"} | [
-0.03436768427491188,
0.05667426437139511,
0.034859638661146164,
0.011780787259340286,
-0.04586043581366539,
0.051492840051651,
0.025562843307852745,
0.060424696654081345,
-0.028026960790157318,
-0.008705968037247658,
0.09913023561239243,
-0.0814574658870697,
0.010921208187937737,
-0.04611... |
57eda407-20df-42d7-8e3c-bbcd33681167 | Q14
sql
SELECT
100.00 * sum(CASE
WHEN p_type LIKE 'PROMO%'
THEN l_extendedprice * (1 - l_discount)
ELSE 0
END) / sum(l_extendedprice * (1 - l_discount)) AS promo_revenue
FROM
lineitem,
part
WHERE
l_partkey = p_partkey
AND ... | {"source_file": "tpch.md"} | [
-0.0046703931875526905,
0.01307822484523058,
0.06133678928017616,
-0.002201720606535673,
-0.09599809348583221,
0.032401055097579956,
0.032384663820266724,
0.06055030971765518,
-0.058292094618082047,
0.023891661316156387,
0.11948640644550323,
-0.06326135247945786,
0.04099459946155548,
-0.02... |
ced81d7f-7509-4339-8e92-384a704b327f | Q19
sql
SELECT
sum(l_extendedprice * (1 - l_discount)) AS revenue
FROM
lineitem,
part
WHERE
(
p_partkey = l_partkey
AND p_brand = 'Brand#12'
AND p_container IN ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG')
AND l_quantity >= 1 AND l_quantity <= 1 + 10
AND p_size BET... | {"source_file": "tpch.md"} | [
0.034780144691467285,
0.07008936256170273,
0.044647928327322006,
0.040129389613866806,
-0.0065474733710289,
0.041920412331819534,
0.08922377228736877,
0.08794588595628738,
-0.059494663029909134,
-0.017347775399684906,
0.08872837573289871,
-0.05071441829204559,
0.019272925332188606,
-0.0104... |
70ae69a4-ed27-4bd1-9b6f-f8bc28bb07f3 | Q22
sql
SELECT
cntrycode,
count(*) AS numcust,
sum(c_acctbal) AS totacctbal
FROM (
SELECT
substring(c_phone FROM 1 for 2) AS cntrycode,
c_acctbal
FROM
customer
WHERE
substring(c_phone FROM 1 for 2) in
('13', '31', '23', '29', '30', '18', '17')
... | {"source_file": "tpch.md"} | [
-0.0010020066983997822,
0.029217945411801338,
0.04127362370491028,
0.02323329448699951,
-0.15162932872772217,
0.056462422013282776,
0.08022882789373398,
0.02829086221754551,
0.05546952411532402,
-0.02479126863181591,
0.119288370013237,
-0.09318237751722336,
0.1046714335680008,
-0.101698152... |
9f0f3058-ae16-46c8-8314-813856bb6b56 | description: 'Dataset with over 100 million records containing information about places on a map, such as shops,
restaurants, parks, playgrounds, and monuments.'
sidebar_label: 'Foursquare places'
slug: /getting-started/example-datasets/foursquare-places
title: 'Foursquare places'
keywords: ['visualizing']
doc_type: '... | {"source_file": "foursquare-os-places.md"} | [
0.08012323826551437,
-0.008485829457640648,
0.03313462436199188,
0.007512710057199001,
0.09225673973560333,
-0.0293867327272892,
-0.03611450642347336,
0.034847162663936615,
-0.05689001828432083,
0.011541972868144512,
0.048036638647317886,
-0.005656319670379162,
0.07483812421560287,
-0.0371... |
d9a37d66-4197-4285-917d-0ffa8fd68e5a | sql title="Query"
SELECT * FROM s3('s3://fsq-os-places-us-east-1/release/dt=2025-04-08/places/parquet/*')
WHERE address IS NOT NULL AND postcode IS NOT NULL AND instagram IS NOT NULL LIMIT 1
response
Row 1:
──────
fsq_place_id: 59b2c754b54618784f259654
name: Villa 722
latitude: ᴺᵁᴸ... | {"source_file": "foursquare-os-places.md"} | [
0.043771736323833466,
0.009549063630402088,
-0.041046008467674255,
-0.010060430504381657,
0.05076955631375313,
-0.04663104936480522,
0.027760906144976616,
-0.06941664218902588,
0.028158431872725487,
0.011233321391046047,
0.11798737943172455,
-0.0986613854765892,
0.028825603425502777,
-0.10... |
3bb2e7bf-e664-4c69-bbe6-7b9f427889ab | sql title="Query"
DESCRIBE s3('s3://fsq-os-places-us-east-1/release/dt=2025-04-08/places/parquet/*')
response title="Response"
┌─name────────────────┬─type────────────────────────┬
1. │ fsq_place_id │ Nullable(String) │
2. │ name │ Nullable(String) │
3. │ latitude ... | {"source_file": "foursquare-os-places.md"} | [
0.03446707874536514,
-0.04216989129781723,
-0.03792319446802139,
0.010143432766199112,
0.003078473499044776,
-0.040512148290872574,
-0.011734913103282452,
-0.046230100095272064,
-0.025042129680514336,
0.051945023238658905,
0.011895379051566124,
-0.05490168556571007,
0.02509121410548687,
-0... |
814d0f0e-218c-4adb-bb87-8cfd2deb12c9 | If you'd like to persist the data on disk, you can use
clickhouse-server
or ClickHouse Cloud.
To create the table, run the following command:
sql title="Query"
CREATE TABLE foursquare_mercator
(
fsq_place_id String,
name String,
latitude Float64,
longitude Float64,
address String,
local... | {"source_file": "foursquare-os-places.md"} | [
0.12050250917673111,
-0.0810551568865776,
-0.06856448203325272,
0.010630851611495018,
0.009600928984582424,
0.019010141491889954,
-0.04521920904517174,
0.012417173944413662,
-0.0022880027536302805,
0.03614840656518936,
0.06825318932533264,
-0.0010436277370899916,
0.013368598185479641,
-0.0... |
77b8ce64-b999-4ac0-a6df-a9cb34cdd4e8 | The
log(tan(...))
part is the core of the Mercator projection formula
multiplying by
0xFFFFFFFF
scales to the full 32-bit integer range
Specifying
MATERIALIZED
makes sure that ClickHouse calculates the values for these
columns when we
INSERT
the data, without having to specify these columns (which are no... | {"source_file": "foursquare-os-places.md"} | [
0.06618072837591171,
0.0017784851370379329,
-0.0006933873519301414,
0.009705707430839539,
0.01328778825700283,
-0.05937836319208145,
-0.018912335857748985,
-0.0005987315089441836,
0.06625613570213318,
-0.017665913328528404,
0.020444225519895554,
0.039754025638103485,
0.030925609171390533,
... |
37c6b6c2-de96-4169-a03d-cedbb0253e16 | description: 'A collection of dislikes of YouTube videos.'
sidebar_label: 'YouTube dislikes'
slug: /getting-started/example-datasets/youtube-dislikes
title: 'YouTube dataset of dislikes'
doc_type: 'guide'
keywords: ['example dataset', 'youtube', 'sample data', 'video analytics', 'dislikes']
In November of 2021, You... | {"source_file": "youtube-dislikes.md"} | [
-0.03148604556918144,
-0.05325914919376373,
-0.03117653913795948,
-0.020218366757035255,
0.05211303010582924,
0.002536446787416935,
0.034615740180015564,
-0.029920315369963646,
0.03825809061527252,
0.02673889324069023,
0.055735696107149124,
-0.05291951447725296,
0.07923506945371628,
-0.051... |
90849fcd-935e-4e2c-8228-366672d10f76 | response
┌─name────────────────┬─type───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬─default_type─┬─default_expression─┬─comment─┬─codec_expression─┬─ttl_expression─┐
│ id │ Nullable(String) ... | {"source_file": "youtube-dislikes.md"} | [
-0.059024736285209656,
0.012273004278540611,
-0.02760537900030613,
0.03580223023891449,
0.024679679423570633,
0.017860589548945427,
-0.020483434200286865,
0.0004459153860807419,
-0.05077670142054558,
0.061257828027009964,
0.10194966197013855,
-0.039626944810152054,
0.07062436640262604,
-0.... |
b03f9d0a-3c2b-4e82-97bd-9d1dfac6d258 | │ is_crawlable │ Nullable(Bool) │ │ │ │ │ │
│ is_live_content │ Nullable(Bool) ... | {"source_file": "youtube-dislikes.md"} | [
-0.04531856253743172,
-0.037470053881406784,
-0.019112572073936462,
0.01067714300006628,
0.10448196530342102,
0.009556838311254978,
-0.03552395477890968,
-0.07736627012491226,
-0.09631352871656418,
0.0338115319609642,
0.05938541516661644,
0.006791135296225548,
0.04594297334551811,
0.012192... |
07614be9-8852-4679-90f3-d28d90855f03 | Create the table {#create-the-table}
Based on the inferred schema, we cleaned up the data types and added a primary key.
Define the following table:
sql
CREATE TABLE youtube
(
`id` String,
`fetch_date` DateTime,
`upload_date_str` String,
`upload_date` Date,
`title` String,
`uploader_id` Stri... | {"source_file": "youtube-dislikes.md"} | [
0.021405784413218498,
-0.09073590487241745,
-0.056128911674022675,
0.02546045184135437,
0.007779343519359827,
0.03474658727645874,
0.021456025540828705,
0.004040652420371771,
-0.04381216689944267,
0.060248203575611115,
0.057705506682395935,
-0.04140876233577728,
0.06879386305809021,
-0.034... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.