id stringlengths 36 36 | document stringlengths 3 3k | metadata stringlengths 23 69 | embeddings listlengths 384 384 |
|---|---|---|---|
34d26788-9c82-47cf-8462-312217eb1b40 | sql
SET use_variant_as_common_type = 1;
SELECT map('a', range(number), 'b', number, 'c', 'str_' || toString(number)) as map_of_variants FROM numbers(3);
text
ββmap_of_variantsββββββββββββββββ
β {'a':[],'b':0,'c':'str_0'} β
β {'a':[0],'b':1,'c':'str_1'} β
β {'a':[0,1],'b':2,'c':'str_2'} β
ββββββββββββββββββββββββ... | {"source_file": "variant.md"} | [
0.05926110967993736,
-0.03666544705629349,
-0.021745136007666588,
-0.016890620812773705,
-0.009297249838709831,
0.016268350183963776,
0.011872619390487671,
0.05605793371796608,
-0.07940050214529037,
-0.04538331925868988,
0.012390991672873497,
-0.01865324191749096,
-0.023199046030640602,
-0... |
d5140343-bd21-4682-a8c0-b2cd32c5e527 | To know what variant is stored in each row function
variantType(variant_column)
can be used. It returns
Enum
with variant type name for each row (or
'None'
if row is
NULL
).
Example:
sql
CREATE TABLE test (v Variant(UInt64, String, Array(UInt64))) ENGINE = Memory;
INSERT INTO test VALUES (NULL), (42), ('Hell... | {"source_file": "variant.md"} | [
0.10755466669797897,
0.017172008752822876,
-0.0706377625465393,
-0.017784256488084793,
-0.004524897783994675,
0.002691128524020314,
0.01438919361680746,
0.01711839996278286,
-0.052609883248806,
0.023234793916344643,
0.045056089758872986,
-0.07299064099788666,
-0.020737145096063614,
-0.0797... |
6ed59470-6007-42dd-93e2-22e9b9df8af4 | sql
SELECT toTypeName(variant) AS type_name, [1,2,3]::Array(UInt64)::Variant(UInt64, String, Array(UInt64)) as variant, variantType(variant) as variant_name
text
ββtype_nameβββββββββββββββββββββββββββββββ¬βvariantββ¬βvariant_nameβββ
β Variant(Array(UInt64), String, UInt64) β [1,2,3] β Array(UInt64) β
ββββββββββββββββββ... | {"source_file": "variant.md"} | [
0.10715887695550919,
-0.024041909724473953,
-0.013145474717020988,
0.03217022493481636,
-0.046762991696596146,
-0.02365840971469879,
0.038656096905469894,
-0.00959756225347519,
-0.06705226749181747,
0.018617644906044006,
0.021298902109265327,
-0.012198231182992458,
-0.04752440005540848,
-0... |
5d152aac-b3ee-47b0-8ba8-d5d892f06b42 | text
ββvββββββββββββββββββββ¬βstrββββββββββββ¬ββnumββ¬βfloatββ¬ββββββββββββββββdateββ¬βarrββββββ
β Hello, World! β Hello, World! β α΄Ία΅α΄Έα΄Έ β α΄Ία΅α΄Έα΄Έ β α΄Ία΅α΄Έα΄Έ β [] β
β 42 β α΄Ία΅α΄Έα΄Έ β 42 β α΄Ία΅α΄Έα΄Έ β α΄Ία΅α΄Έα΄Έ β [] β
β 42.42 β α΄Ία΅α΄Έα΄Έ β α΄Ία΅α΄Έα΄Έ β 42.42 β... | {"source_file": "variant.md"} | [
0.0008688006200827658,
0.06679055094718933,
0.08896025270223618,
-0.024742042645812035,
0.002282872563228011,
-0.04670201241970062,
-0.004162836354225874,
0.043808624148368835,
-0.03861527144908905,
-0.040805406868457794,
0.019675763323903084,
-0.023146454244852066,
-0.000006497304184449604,... |
e7c4342c-e007-496e-bbb6-72a8bd559898 | Compare
Variant
subcolumn with required type:
sql
SELECT * FROM test WHERE v2.`Array(UInt32)` == [1,2,3] -- or using variantElement(v2, 'Array(UInt32)')
text
ββv1ββ¬βv2βββββββ
β 42 β [1,2,3] β
ββββββ΄ββββββββββ
Sometimes it can be useful to make additional check on variant type as subcolumns with complex types ... | {"source_file": "variant.md"} | [
0.07936354726552963,
-0.005772612523287535,
0.0002314556040801108,
0.020869577303528786,
0.01574072241783142,
-0.052140288054943085,
0.01127619855105877,
-0.0073638418689370155,
-0.09210395067930222,
-0.02228565886616707,
-0.00793032068759203,
-0.041662462055683136,
-0.05914219468832016,
0... |
2895ee96-9f02-498c-98d5-a298e014a2e1 | sql
SELECT JSONExtractKeysAndValues('{"a" : 42, "b" : "Hello", "c" : [1,2,3]}', 'Variant(UInt32, String, Array(UInt32))') AS variants, arrayMap(x -> (x.1, variantType(x.2)), variants) AS variant_types
text
ββvariantsββββββββββββββββββββββββββββββββ¬βvariant_typesββββββββββββββββββββββββββββββββββββββββββ
β [('a',42),(... | {"source_file": "variant.md"} | [
0.08326413482427597,
0.029219690710306168,
0.07436896860599518,
-0.014985335990786552,
-0.06759066134691238,
0.01594248227775097,
0.06140107661485672,
-0.016447946429252625,
-0.04814980924129486,
-0.030168656259775162,
0.04395764693617821,
-0.03296041116118431,
0.017482010647654533,
-0.017... |
1db3950a-0c7c-4839-81bc-602f45ec55d7 | description: 'Documentation for the UUID data type in ClickHouse'
sidebar_label: 'UUID'
sidebar_position: 24
slug: /sql-reference/data-types/uuid
title: 'UUID'
doc_type: 'reference'
UUID
A Universally Unique Identifier (UUID) is a 16-byte value used to identify records. For detailed information about UUIDs, see
... | {"source_file": "uuid.md"} | [
-0.04111143946647644,
-0.032215435057878494,
-0.06532224267721176,
0.0059321545995771885,
-0.0022471772972494364,
-0.07409829646348953,
0.049876868724823,
-0.052813805639743805,
-0.01889858767390251,
-0.06841805577278137,
0.039240047335624695,
0.03176676481962204,
0.04773199185729027,
-0.0... |
4f33cd6d-3597-47fe-b94c-e102075d5d30 | ```sql
CREATE TABLE t_uuid (x UUID, y String) ENGINE=TinyLog
INSERT INTO t_uuid SELECT generateUUIDv4(), 'Example 1'
SELECT * FROM t_uuid
```
Result:
text
βββββββββββββββββββββββββββββββββββββxββ¬βyββββββββββ
β 417ddc5d-e556-4d27-95dd-a34d84e46a50 β Example 1 β
ββββββββββββββββββββββββββββββββββββββββ΄βββββββββββ... | {"source_file": "uuid.md"} | [
0.025897720828652382,
0.010799737647175789,
-0.03189287707209587,
0.018815960735082626,
0.013492305763065815,
-0.04412783309817314,
0.058877404779195786,
0.015514581464231014,
-0.05027144402265549,
-0.00819158460944891,
0.05471843108534813,
-0.051161542534828186,
0.031718917191028595,
-0.0... |
9a739c91-50b4-466e-8f91-ac026b17edc0 | description: 'Documentation for deprecated Object data type in ClickHouse'
keywords: ['object', 'data type']
sidebar_label: 'Object Data Type'
sidebar_position: 26
slug: /sql-reference/data-types/object-data-type
title: 'Object Data Type '
doc_type: 'reference'
import DeprecatedBadge from '@theme/badges/DeprecatedB... | {"source_file": "json.md"} | [
-0.06748947501182556,
0.00912204384803772,
0.012622958980500698,
0.06917331367731094,
-0.03627888113260269,
0.024070998653769493,
-0.03945290297269821,
0.06134277582168579,
-0.058846596628427505,
-0.04232992231845856,
0.014637977816164494,
0.06732936948537827,
-0.010831635445356369,
0.0706... |
54ef6fa3-ebbd-478d-b9dc-a8d7cf01482a | description: 'Documentation for the Date data type in ClickHouse'
sidebar_label: 'Date'
sidebar_position: 12
slug: /sql-reference/data-types/date
title: 'Date'
doc_type: 'reference'
Date
A date. Stored in two bytes as the number of days since 1970-01-01 (unsigned). Allows storing values from just after the beginn... | {"source_file": "date.md"} | [
0.03267687186598778,
0.033898111432790756,
-0.036705534905195236,
0.08426256477832794,
-0.03488883376121521,
0.022084029391407967,
-0.00568743608891964,
0.06616346538066864,
-0.030201377347111702,
0.01315865758806467,
0.006353141274303198,
-0.0338640995323658,
-0.009556581266224384,
-0.046... |
4187822b-f963-43d8-a115-a7897616a6b4 | description: 'Documentation for the LowCardinality optimization for string columns'
sidebar_label: 'LowCardinality(T)'
sidebar_position: 42
slug: /sql-reference/data-types/lowcardinality
title: 'LowCardinality(T)'
doc_type: 'reference'
LowCardinality(T)
Changes the internal representation of other data types to b... | {"source_file": "lowcardinality.md"} | [
0.06635364890098572,
0.022891182452440262,
-0.07960192114114761,
0.049003567546606064,
-0.0761265978217125,
-0.08482979238033295,
0.020837489515542984,
0.03607715666294098,
-0.013094369322061539,
-0.05811090022325516,
0.03957444429397583,
0.020570095628499985,
0.0431700237095356,
-0.050169... |
5bb727d6-9edc-4802-bd2f-565978535b25 | description: 'Documentation for the AggregateFunction data type in ClickHouse, which
stores intermediate states of aggregate functions'
keywords: ['AggregateFunction', 'Type']
sidebar_label: 'AggregateFunction'
sidebar_position: 46
slug: /sql-reference/data-types/aggregatefunction
title: 'AggregateFunction Type'
doc_ty... | {"source_file": "aggregatefunction.md"} | [
-0.04451150819659233,
-0.09569299221038818,
0.0048143151216208935,
0.05566493421792984,
-0.10175617784261703,
-0.009391938336193562,
0.0480898879468441,
0.03600035980343819,
-0.019033297896385193,
-0.01373250037431717,
0.002083912957459688,
-0.021418221294879913,
0.05897878110408783,
-0.05... |
6bd434c7-a1de-4221-999b-de98a15856ce | -Merge
combinator.
An aggregate function with the
-Merge
combinator appended to it takes a set of
states, combines them, and returns the result of the complete data aggregation.
For example, the following two queries return the same result:
```sql
SELECT uniq(UserID) FROM table
SELECT uniqMerge(state) FROM ... | {"source_file": "aggregatefunction.md"} | [
-0.05375373736023903,
-0.045484885573387146,
0.033848460763692856,
0.030760282650589943,
-0.04976968467235565,
-0.026690630242228508,
0.0804324522614479,
-0.009535752236843109,
0.010424821637570858,
-0.06443601846694946,
0.03855343908071518,
0.029348434880375862,
0.03921814262866974,
-0.04... |
b52fb4dd-f1c3-46dc-8781-9cf20440caad | description: 'Documentation for the Enum data type in ClickHouse, which represents
a set of named constant values'
sidebar_label: 'Enum'
sidebar_position: 20
slug: /sql-reference/data-types/enum
title: 'Enum'
doc_type: 'reference'
Enum
Enumerated type consisting of named values.
Named values can be declared a... | {"source_file": "enum.md"} | [
0.05108226090669632,
-0.06670889258384705,
-0.08810551464557648,
-0.004381105769425631,
-0.04983484372496605,
-0.03918946161866188,
0.053585272282361984,
0.012059725821018219,
-0.0536404550075531,
0.029695652425289154,
0.05841780826449394,
-0.046954333782196045,
0.062246907502412796,
-0.06... |
51800e95-8338-4cb4-8bcf-15ae54492057 | General Rules and Usage {#general-rules-and-usage}
Each of the values is assigned a number in the range
-128 ... 127
for
Enum8
or in the range
-32768 ... 32767
for
Enum16
. All the strings and numbers must be different. An empty string is allowed. If this type is specified (in a table definition), numbers can ... | {"source_file": "enum.md"} | [
0.07073161005973816,
-0.008742107078433037,
-0.07038048654794693,
-0.0441981703042984,
-0.03475628048181534,
-0.020212212577462196,
0.02507377788424492,
0.02627432718873024,
-0.018035776913166046,
0.028903963044285774,
0.09123566746711731,
-0.031911227852106094,
0.08892649412155151,
-0.031... |
57f3faea-c53e-4fb0-9bba-dc8f94cc7324 | Using ALTER, it is possible to change an Enum8 to an Enum16 or vice versa, just like changing an Int8 to Int16. | {"source_file": "enum.md"} | [
0.019803721457719803,
0.03800014406442642,
-0.01685114949941635,
-0.06276094913482666,
-0.05301970615983009,
-0.019601160660386086,
-0.05162150785326958,
-0.01171329990029335,
-0.10250324010848999,
-0.00918502639979124,
0.021340565755963326,
-0.06228838860988617,
-0.018876967951655388,
0.0... |
b71d6c35-27b5-4b29-9ca4-43d4bd84a472 | description: 'Documentation for the String data type in ClickHouse'
sidebar_label: 'String'
sidebar_position: 8
slug: /sql-reference/data-types/string
title: 'String'
doc_type: 'reference'
String
Strings of an arbitrary length. The length is not limited. The value can contain an arbitrary set of bytes, including ... | {"source_file": "string.md"} | [
0.057636361569166183,
-0.0780913457274437,
-0.046395864337682724,
0.010168801993131638,
-0.11344464123249054,
-0.011832881718873978,
0.06735897064208984,
0.028582394123077393,
-0.024533050134778023,
-0.020082872360944748,
0.023806974291801453,
-0.047458015382289886,
0.07522071152925491,
-0... |
80c10bce-e5ed-4eee-bec3-8cc8da614c0f | description: 'Documentation for the FixedString data type in ClickHouse'
sidebar_label: 'FixedString(N)'
sidebar_position: 10
slug: /sql-reference/data-types/fixedstring
title: 'FixedString(N)'
doc_type: 'reference'
FixedString(N)
A fixed-length string of
N
bytes (neither characters nor code points).
To decla... | {"source_file": "fixedstring.md"} | [
0.0024422623682767153,
0.011308000423014164,
-0.10043352842330933,
0.020193466916680336,
-0.08148061484098434,
-0.011716003529727459,
0.014433017000555992,
0.06837953627109528,
-0.018322154879570007,
0.0017676198622211814,
0.0033481870777904987,
0.042529232800006866,
0.03151319921016693,
-... |
46e181e5-1c5b-4f47-8737-a38c2bafb610 | Query id: c32cec28-bb9e-4650-86ce-d74a1694d79e
{"name":"a\u0000"}
SELECT name
FROM FixedStringTable
WHERE name LIKE 'a'
FORMAT JSONStringsEachRow
0 rows in set.
SELECT name
FROM FixedStringTable
WHERE name LIKE 'a\0'
FORMAT JSONStringsEachRow
{"name":"a\u0000"}
``` | {"source_file": "fixedstring.md"} | [
0.021410997956991196,
0.04554234817624092,
0.0066411313600838184,
0.05617890506982803,
-0.14390286803245544,
0.06318899989128113,
0.02591238170862198,
0.0313725546002388,
0.007374487351626158,
-0.007369941100478172,
0.0021974823903292418,
-0.04670102149248123,
0.036838509142398834,
-0.0587... |
4fa3d5ec-6944-4f13-97a1-aba587e48f9b | description: 'Documentation for signed and unsigned integer data types in ClickHouse,
ranging from 8-bit to 256-bit'
sidebar_label: 'Int | UInt'
sidebar_position: 2
slug: /sql-reference/data-types/int-uint
title: 'Int | UInt Types'
doc_type: 'reference'
ClickHouse offers a number of fixed-length integers,
with a... | {"source_file": "int-uint.md"} | [
0.04828854277729988,
-0.0016625632997602224,
-0.06276895105838776,
-0.022854739800095558,
-0.06787046045064926,
-0.02712184563279152,
0.029094090685248375,
0.04217592254281044,
-0.05217699334025383,
-0.06845548748970032,
-0.02357151173055172,
-0.03520044684410095,
0.07002261281013489,
-0.0... |
d4c75ea5-30dc-4d99-96e6-acb81bf020aa | Integer Aliases {#integer-aliases}
Integer types have the following aliases:
| Type | Alias |
|---------|-----------------------------------------------------------------------------------|
|
Int8
|
TINYINT
,
INT1
,
BYTE
,
TINYINT... | {"source_file": "int-uint.md"} | [
0.04245346039533615,
0.04172162339091301,
-0.014032790437340736,
-0.060942143201828,
-0.026445535942912102,
-0.04117349162697792,
0.0797208696603775,
0.07478535920381546,
-0.04533180594444275,
-0.03775939345359802,
-0.03297311067581177,
-0.06774739176034927,
0.062279414385557175,
0.0234098... |
20f156ec-f677-4c23-aea8-f098351ed439 | description: 'Documentation for the DateTime64 data type in ClickHouse, which stores
timestamps with sub-second precision'
sidebar_label: 'DateTime64'
sidebar_position: 18
slug: /sql-reference/data-types/datetime64
title: 'DateTime64'
doc_type: 'reference'
DateTime64
Allows to store an instant in time, that can... | {"source_file": "datetime64.md"} | [
0.02135133184492588,
0.01355704665184021,
-0.06341616064310074,
0.06433876603841782,
-0.03665308654308319,
-0.003916148561984301,
-0.025901688262820244,
0.05427279323339462,
-0.008139587938785553,
-0.010661155916750431,
-0.00973285362124443,
-0.026101263239979744,
-0.023986848071217537,
-0... |
5d9dd7d6-c815-4206-806a-903ae9d3c1de | When inserting string value as datetime, it is treated as being in column timezone.
'2019-01-01 00:00:00'
will be treated as being in
Asia/Istanbul
timezone and stored as
1546290000000
.
Filtering on
DateTime64
values
sql
SELECT * FROM dt64 WHERE timestamp = toDateTime64('2019-01-01 00:00:00', 3, 'As... | {"source_file": "datetime64.md"} | [
0.061532650142908096,
-0.022048626095056534,
-0.03348314017057419,
0.027489667758345604,
-0.015628822147846222,
-0.015457872301340103,
0.04992285743355751,
0.021537456661462784,
0.050801608711481094,
0.010517516173422337,
-0.007984795607626438,
-0.11629430949687958,
-0.049969885498285294,
... |
ee07d02f-26f2-4ce2-8c19-dc120d8939fe | description: 'Documentation for the IPv6 data type in ClickHouse, which stores IPv6
addresses as 16-byte values'
sidebar_label: 'IPv6'
sidebar_position: 30
slug: /sql-reference/data-types/ipv6
title: 'IPv6'
doc_type: 'reference'
IPv6 {#ipv6}
IPv6 addresses. Stored in 16 bytes as UInt128 big-endian.
Basic Usag... | {"source_file": "ipv6.md"} | [
0.03931491822004318,
-0.040007688105106354,
-0.007036922965198755,
0.002187452744692564,
-0.09705813974142075,
-0.0013090946013107896,
-0.055868782103061676,
-0.039880067110061646,
-0.04024539142847061,
0.059637658298015594,
0.00777827063575387,
0.05315408483147621,
0.007531418930739164,
-... |
2a6a5968-3e3b-4827-855a-7027e43186a8 | description: 'Documentation for the Array data type in ClickHouse'
sidebar_label: 'Array(T)'
sidebar_position: 32
slug: /sql-reference/data-types/array
title: 'Array(T)'
doc_type: 'reference'
Array(T)
An array of
T
-type items, with the starting array index as 1.
T
can be any data type, including an array.
C... | {"source_file": "array.md"} | [
0.030393406748771667,
-0.028853628784418106,
-0.031168567016720772,
0.039681512862443924,
-0.10769832879304886,
-0.04627911373972893,
0.10564655810594559,
-0.023949034512043,
-0.0680307000875473,
-0.01781994104385376,
-0.03092075325548649,
0.03464263305068016,
0.05170641094446182,
-0.01360... |
7f8b7d23-7a2c-4a72-b205-0f2d9db7c8f9 | Example
sql
CREATE TABLE t_arr (arr Array(Tuple(field1 UInt32, field2 String))) ENGINE = MergeTree ORDER BY tuple();
INSERT INTO t_arr VALUES ([(1, 'Hello'), (2, 'World')]), ([(3, 'This'), (4, 'is'), (5, 'subcolumn')]);
SELECT arr.field1, toTypeName(arr.field1), arr.field2, toTypeName(arr.field2) from t_arr;
test
β... | {"source_file": "array.md"} | [
0.06786273419857025,
0.00310442759655416,
0.016704538837075233,
-0.019277101382613182,
-0.04645313695073128,
-0.09633205831050873,
0.016110314056277275,
-0.029619039967656136,
-0.04548164829611778,
0.022008921951055527,
-0.01923251710832119,
-0.010625210590660572,
-0.015098483301699162,
-0... |
b2514f85-7ec8-4691-a87b-258842e52d33 | description: 'Documentation for the DateTime data type in ClickHouse, which stores
timestamps with second precision'
sidebar_label: 'DateTime'
sidebar_position: 16
slug: /sql-reference/data-types/datetime
title: 'DateTime'
doc_type: 'reference'
DateTime
Allows to store an instant in time, that can be expressed ... | {"source_file": "datetime.md"} | [
-0.04502402991056442,
0.030237488448619843,
-0.03288143500685692,
0.06145808473229408,
0.008014686405658722,
-0.025943007320165634,
0.02735704742372036,
0.05573699250817299,
0.028510505333542824,
0.012017335742712021,
-0.03829742223024368,
-0.003658733330667019,
-0.01994761824607849,
0.037... |
2af03550-66e0-4c8f-ba7a-2b31a170aab9 | 1.
Creating a table with a
DateTime
-type column and inserting data into it:
sql
CREATE TABLE dt
(
`timestamp` DateTime('Asia/Istanbul'),
`event_id` UInt8
)
ENGINE = TinyLog;
```sql
-- Parse DateTime
-- - from string,
-- - from integer interpreted as number of seconds since 1970-01-01.
INSERT INTO dt VALU... | {"source_file": "datetime.md"} | [
0.038832928985357285,
0.02560860477387905,
-0.012209937907755375,
0.06001145392656326,
-0.01865731179714203,
-0.021059703081846237,
0.05832468345761299,
0.05855061113834381,
0.04744816571474075,
-0.00934132281690836,
0.05328734964132309,
-0.11876393854618073,
-0.031380027532577515,
0.02055... |
3b6956f7-66dd-433c-b2b5-5135bc9eca67 | If the time transition (due to daylight saving time or for other reasons) was performed at a point of time that is not a multiple of 15 minutes, you can also get incorrect results at this specific day.
Non-monotonic calendar dates. For example, in Happy Valley - Goose Bay, the time was transitioned one hour backwards... | {"source_file": "datetime.md"} | [
-0.009940830990672112,
-0.030953921377658844,
0.06510163098573685,
0.050911106169223785,
0.04074006527662277,
-0.07982106506824493,
-0.06391916424036026,
-0.029344968497753143,
0.028562305495142937,
-0.018251631408929825,
0.004996672738343477,
-0.001995525322854519,
-0.08011920750141144,
0... |
7939576f-2fd1-4e7c-9a2f-91179e33f5c0 | βββββββββββββββββtimeββ¬ββββββone_hour_laterββ
β 2023-03-26 00:30:00 β 2023-03-26 02:30:00 β
βββββββββββββββββββββββ΄ββββββββββββββββββββββ
```
In this case, ClickHouse shifts the non-existent time
2023-03-26 01:30:00
back to
2023-03-26 00:30:00
.
See Also {#see-also}
Type conversion functions
Functions for ... | {"source_file": "datetime.md"} | [
-0.012223445810377598,
-0.0009416568791493773,
0.021198967471718788,
0.020734740421175957,
0.022150050848722458,
-0.07405070215463638,
0.007953489199280739,
-0.043272387236356735,
-0.002679497003555298,
-0.03298656642436981,
0.00385014689527452,
-0.03913729265332222,
-0.033497121185064316,
... |
335d1b82-b646-49bb-96e0-7e5ae39f637a | description: 'Documentation for Data Types in ClickHouse'
sidebar_label: 'List of data types'
sidebar_position: 1
slug: /sql-reference/data-types/
title: 'Data Types in ClickHouse'
doc_type: 'reference'
Data Types in ClickHouse
This section describes the data types supported by ClickHouse, for example
integers
,... | {"source_file": "index.md"} | [
0.017588695511221886,
-0.0800364688038826,
-0.045523274689912796,
0.02458803541958332,
-0.03715520352125168,
-0.03897930681705475,
0.06570819765329361,
0.00851220078766346,
-0.067258320748806,
-0.04224725067615509,
0.05183706060051918,
0.012690187431871891,
0.026816176250576973,
-0.0385481... |
e1d54c26-75fb-40d5-8f80-08fe0429b716 | description: 'Documentation for the Nullable data type modifier in ClickHouse'
sidebar_label: 'Nullable(T)'
sidebar_position: 44
slug: /sql-reference/data-types/nullable
title: 'Nullable(T)'
doc_type: 'reference'
Nullable(T)
Allows to store special marker (
NULL
) that denotes "missing value" alongside normal val... | {"source_file": "nullable.md"} | [
0.028729069977998734,
0.006164877209812403,
-0.0596335306763649,
0.07770344614982605,
-0.02259359136223793,
0.044980328530073166,
0.017975617200136185,
-0.01487025897949934,
-0.09247208386659622,
-0.006993577815592289,
0.08500658720731735,
-0.030257603153586388,
0.06377553194761276,
-0.056... |
fc750a85-115e-41d6-bd15-4a16a2f9f865 | description: 'Documentation for the IPv4 data type in ClickHouse'
sidebar_label: 'IPv4'
sidebar_position: 28
slug: /sql-reference/data-types/ipv4
title: 'IPv4'
doc_type: 'reference'
IPv4 {#ipv4}
IPv4 addresses. Stored in 4 bytes as UInt32.
Basic Usage {#basic-usage}
```sql
CREATE TABLE hits (url String, from ... | {"source_file": "ipv4.md"} | [
0.07724490761756897,
-0.049449242651462555,
-0.0055034165270626545,
0.008079270832240582,
-0.09204726666212082,
-0.0066078705713152885,
-0.018094634637236595,
-0.02260996587574482,
-0.04679698497056961,
0.06456790864467621,
0.030648665502667427,
0.01837075501680374,
0.06409571319818497,
-0... |
90db4905-7cf0-4e3d-a7fb-4d38df72d636 | description: 'Documentation for the Time data type in ClickHouse, which stores
the time range with second precision'
slug: /sql-reference/data-types/time
sidebar_position: 15
sidebar_label: 'Time'
title: 'Time'
doc_type: 'reference'
Time
Data type
Time
represents a time with hour, minute, and second component... | {"source_file": "time.md"} | [
-0.019901921972632408,
0.006673138123005629,
-0.027441103011369705,
0.01899791695177555,
-0.084175243973732,
-0.07215053588151932,
0.026289351284503937,
0.0413932241499424,
0.014107353053987026,
-0.05373917892575264,
0.009816639125347137,
-0.051523711532354355,
-0.00002483873686287552,
0.0... |
3274dbd6-4c9c-4a4d-ae09-6eadf448b8b3 | 3.
Inspecting the resulting type:
sql
SELECT CAST('14:30:25' AS Time) AS column, toTypeName(column) AS type
text
βββββcolumnββ¬βtypeββ
1. β 14:30:25 β Time β
βββββββββββββ΄βββββββ
See Also {#see-also}
Type conversion functions
Functions for working with dates and times
Functions for working with arra... | {"source_file": "time.md"} | [
0.06298598647117615,
0.035300325602293015,
-0.0011521083069965243,
-0.002080479171127081,
-0.040282733738422394,
-0.01967768371105194,
0.10830313712358475,
0.06048882380127907,
-0.020064756274223328,
0.001057842280715704,
-0.025124410167336464,
-0.04159194603562355,
-0.05305515602231026,
0... |
32ce33fe-999c-40c4-afb7-c860290449f4 | description: 'Documentation for the Date32 data type in ClickHouse, which stores dates
with an extended range compared to Date'
sidebar_label: 'Date32'
sidebar_position: 14
slug: /sql-reference/data-types/date32
title: 'Date32'
doc_type: 'reference'
Date32
A date. Supports the date range same with
DateTime64
.... | {"source_file": "date32.md"} | [
0.019234320148825645,
0.030135415494441986,
-0.016384132206439972,
0.0653911828994751,
-0.07907859236001968,
0.023767385631799698,
-0.025340456515550613,
0.07251798361539841,
-0.05079296603798866,
0.007125946693122387,
0.02574816718697548,
-0.0693659856915474,
0.036329444497823715,
-0.0055... |
90635d38-6131-4a25-b898-1c7335e516e5 | description: 'Documentation for geometric data types in ClickHouse used for representing
geographical objects and locations'
sidebar_label: 'Geo'
sidebar_position: 54
slug: /sql-reference/data-types/geo
title: 'Geometric'
doc_type: 'reference'
ClickHouse supports data types for representing geographical objects β... | {"source_file": "geo.md"} | [
0.06178779900074005,
0.004510083701461554,
-0.03864608332514763,
0.011508684605360031,
-0.08949679881334305,
-0.0637262687087059,
0.08431262522935867,
-0.017468197271227837,
-0.006670570001006126,
-0.04555132985115051,
-0.010449453257024288,
0.0045879860408604145,
0.07035335898399353,
-0.0... |
b15c9810-5dab-4a19-8b61-a9475d81276b | Result:
text
ββpgβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¬βtoTypeName(pg)ββ
β [[(20,20),(50,20),(50,50),(20,50)],[(30,30),(50,50),(50,30)]] β Polygon β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ΄βββββββββββββββββ
MultiPolygon {#multipolygon}
MultiPolygon
consists ... | {"source_file": "geo.md"} | [
0.07316234707832336,
0.04454857483506203,
-0.0032625971361994743,
0.020324204117059708,
-0.024545887485146523,
-0.06746893376111984,
0.11913228034973145,
-0.03716327250003815,
-0.03702814504504204,
-0.020738333463668823,
-0.07859265804290771,
-0.041573427617549896,
0.015271175652742386,
-0... |
51f041cf-5c87-4034-832a-89b60cfa4cd6 | SELECT * FROM geo_dst;
```
Result:
text
ββgeomββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
1. β [[(1,0),(10,0),(10,10),(0,10),(1,0)],[(4,4),(5,4),(5,5),(4,5),(4,4)]] β
2. β (0,0) ... | {"source_file": "geo.md"} | [
-0.00941078644245863,
0.016522850841283798,
0.04506189748644829,
-0.042597681283950806,
0.044666606932878494,
-0.06556429713964462,
0.1124308630824089,
-0.061469826847314835,
-0.07555770128965378,
-0.03358978033065796,
0.00023382712970487773,
0.03670596331357956,
-0.04391283541917801,
-0.0... |
02ee9d3a-e37c-4aa4-b222-3d953b6cca6d | description: 'Documentation for the Tuple data type in ClickHouse'
sidebar_label: 'Tuple(T1, T2, ...)'
sidebar_position: 34
slug: /sql-reference/data-types/tuple
title: 'Tuple(T1, T2, ...)'
doc_type: 'reference'
Tuple(T1, T2, ...)
A tuple of elements, each having an individual
type
. Tuple must contain at least ... | {"source_file": "tuple.md"} | [
-0.02118961326777935,
-0.037291135638952255,
-0.03463155776262283,
0.010477465577423573,
-0.054153844714164734,
-0.029362905770540237,
0.05338950455188751,
-0.020444270223379135,
-0.05977104604244232,
-0.03720076009631157,
0.03981130197644234,
-0.0013649372849613428,
0.03090355359017849,
-... |
9848dc0b-512d-4ff0-92ba-659e166af150 | ββtupleElement(a, 2)ββ
β 10 β
β -10 β
ββββββββββββββββββββββ
```
Comparison operations with Tuple {#comparison-operations-with-tuple}
Two tuples are compared by sequentially comparing their elements from the left to the right. If first tuples element is greater (smaller) than the seco... | {"source_file": "tuple.md"} | [
0.0020954578649252653,
0.024177948012948036,
0.041314274072647095,
0.020672012120485306,
-0.03509505093097687,
-0.04427460953593254,
-0.011548620648682117,
-0.03922923654317856,
-0.07125222682952881,
0.028915245085954666,
0.024045290425419807,
0.02106918953359127,
0.036217425018548965,
-0.... |
543c56d7-527a-47fe-b761-f6bea9cb09ee | description: 'Documentation for the Decimal data types in ClickHouse, which provide
fixed-point arithmetic with configurable precision'
sidebar_label: 'Decimal'
sidebar_position: 6
slug: /sql-reference/data-types/decimal
title: 'Decimal, Decimal(P), Decimal(P, S), Decimal32(S), Decimal64(S), Decimal128(S),
Decimal2... | {"source_file": "decimal.md"} | [
-0.011290794238448143,
-0.011110099963843822,
-0.10399392992258072,
0.005936794448643923,
-0.06841671466827393,
0.01609685644507408,
0.04222138598561287,
0.0792338028550148,
-0.06709083169698715,
-0.01447034627199173,
-0.024661879986524582,
-0.06859516352415085,
0.04330958425998688,
-0.027... |
06cfc9b5-63bd-411d-8fc3-3aaab38d88bd | add, subtract: S = max(S1, S2).
multiply: S = S1 + S2.
divide: S = S1.
For similar operations between Decimal and integers, the result is Decimal of the same size as an argument.
Operations between Decimal and Float32/Float64 are not defined. If you need them, you can explicitly cast one of argument using toD... | {"source_file": "decimal.md"} | [
0.009249033406376839,
0.034134391695261,
-0.048833444714546204,
-0.06189052015542984,
0.03319086506962776,
-0.07904937118291855,
-0.05271022766828537,
0.11422833055257797,
-0.011596014723181725,
0.018669113516807556,
-0.10360583662986755,
-0.07716590911149979,
0.007482819724828005,
0.04715... |
0ff455bc-082f-440a-8038-b7a3fd4080a7 | description: 'Documentation for the Boolean data type in ClickHouse'
sidebar_label: 'Boolean'
sidebar_position: 33
slug: /sql-reference/data-types/boolean
title: 'Bool'
doc_type: 'reference'
Bool
Type
bool
is internally stored as UInt8. Possible values are
true
(1),
false
(0).
```sql
SELECT true AS col, t... | {"source_file": "boolean.md"} | [
0.05248485133051872,
-0.010407338850200176,
-0.05722302198410034,
0.09627039730548859,
-0.054836008697748184,
-0.016866926103830338,
0.09337159246206284,
-0.04739072173833847,
-0.06954869627952576,
0.01785844936966896,
0.05617913976311684,
-0.03208623826503754,
0.06551366299390793,
-0.0817... |
e635d76c-4b06-4933-a400-5b6de7ed2064 | description: 'Documentation for the JSON data type in ClickHouse, which provides native
support for working with JSON data'
keywords: ['json', 'data type']
sidebar_label: 'JSON'
sidebar_position: 63
slug: /sql-reference/data-types/newjson
title: 'JSON Data Type'
doc_type: 'reference'
import {CardSecondary} from '... | {"source_file": "newjson.md"} | [
-0.05648839473724365,
-0.01661943830549717,
-0.039323966950178146,
0.043424107134342194,
-0.02388167381286621,
-0.02942386269569397,
0.00026842457009479403,
0.030070945620536804,
-0.05353539064526558,
-0.048796530812978745,
0.06655911356210709,
0.021218810230493546,
-0.012123852968215942,
... |
fe1e3049-2e99-4823-9cfa-49ae6ceaf2f8 | Where the parameters in the syntax above are defined as:
| Parameter | Description ... | {"source_file": "newjson.md"} | [
0.023246489465236664,
0.04849613085389137,
-0.06527002900838852,
0.011540370993316174,
-0.10295005142688751,
0.035583291202783585,
0.026648975908756256,
0.06702332198619843,
-0.02166999690234661,
-0.04202210530638695,
0.04296814277768135,
-0.08303096890449524,
0.03155636414885521,
-0.05084... |
b31d0486-4074-4b84-ba43-ba1681526b0c | Creating JSON {#creating-json}
In this section we'll take a look at the various ways that you can create
JSON
.
Using
JSON
in a table column definition {#using-json-in-a-table-column-definition}
sql title="Query (Example 1)"
CREATE TABLE test (json JSON) ENGINE = Memory;
INSERT INTO test VALUES ('{"a" : {"b" :... | {"source_file": "newjson.md"} | [
-0.016513550654053688,
0.023609783500432968,
-0.005272221751511097,
0.040262605994939804,
-0.09519767016172409,
-0.008132210932672024,
0.013867308385670185,
0.04999920353293419,
-0.039164431393146515,
0.0017370145069435239,
0.059367939829826355,
-0.031289003789424896,
0.05572256073355675,
... |
573fbeca-0522-466c-b6ff-2fe8fa8652c4 | :::note
JSON paths are stored flattened. This means that when a JSON object is formatted from a path like
a.b.c
it is not possible to know whether the object should be constructed as
{ "a.b.c" : ... }
or
{ "a" " {"b" : {"c" : ... }}}
.
Our implementation will always assume the latter.
For example:
sql
SELECT C... | {"source_file": "newjson.md"} | [
-0.05159272626042366,
-0.021614011377096176,
0.011983472853899002,
0.0811111181974411,
-0.08530043810606003,
-0.0313202403485775,
0.011723986826837063,
0.02617671526968479,
0.000313811469823122,
-0.036680590361356735,
-0.03599369898438454,
-0.010544915683567524,
-0.0002717018942348659,
0.0... |
b45d8c1e-af42-4ed0-922e-913faf76d49e | If the requested path wasn't found in the data, it will be filled with
NULL
values:
sql title="Query"
SELECT json.non.existing.path FROM test;
text title="Response"
ββjson.non.existing.pathββ
β α΄Ία΅α΄Έα΄Έ β
β α΄Ία΅α΄Έα΄Έ β
β α΄Ία΅α΄Έα΄Έ β
ββββββββββββββββββββββββββ
Let's check ... | {"source_file": "newjson.md"} | [
-0.05769237130880356,
-0.04523135721683502,
-0.03500216081738472,
0.08967063575983047,
-0.1021801307797432,
-0.06255819648504257,
-0.005070072133094072,
0.01946989633142948,
-0.0013565656263381243,
-0.03508942946791649,
0.026476098224520683,
-0.052692633122205734,
-0.003801558632403612,
0.... |
f98e5a51-ff1f-444e-8ff7-73963acd523b | The
JSON
type supports reading nested objects as sub-columns with type
JSON
using the special syntax
json.^some.path
:
sql title="Query"
CREATE TABLE test (json JSON) ENGINE = Memory;
INSERT INTO test VALUES ('{"a" : {"b" : {"c" : 42, "g" : 42.42}}, "c" : [1, 2, 3], "d" : {"e" : {"f" : {"g" : "Hello, World", "h"... | {"source_file": "newjson.md"} | [
-0.009927324950695038,
0.027503695338964462,
0.02607366442680359,
0.06181510165333748,
-0.08266075700521469,
-0.041226740926504135,
-0.009427404031157494,
0.041059862822294235,
-0.029753535985946655,
-0.008772831410169601,
-0.0015189655823633075,
-0.009097641333937645,
0.014034935273230076,
... |
acd02f66-9166-44d3-8b15-96e99cd1ff9b | text title="Response"
ββpaths_with_typesβββββββββββββ
β {'a':'String','b':'String'} β
βββββββββββββββββββββββββββββββ
sql title="Query"
SELECT JSONAllPathsWithTypes('{"a" : [1, 2, 3]}'::JSON) AS paths_with_types settings schema_inference_make_columns_nullable=1;
text title="Response"
ββpaths_with_typesβββββββββββββ... | {"source_file": "newjson.md"} | [
-0.00035558571107685566,
0.01851586252450943,
-0.047831129282712936,
0.08475813269615173,
-0.07767859846353531,
-0.020651986822485924,
0.01541875023394823,
0.012373128905892372,
-0.044702623039484024,
-0.01601061224937439,
0.028961211442947388,
-0.012511765584349632,
-0.013911477290093899,
... |
325faefc-60d2-4872-8e3d-638a26b911d9 | sql title="Query"
SELECT json.a.b, dynamicType(json.a.b) FROM test;
text title="Response"
ββjson.a.bβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¬βdynamicType(json.a.b)βββββββββββββββββββββββββββββββββββββ
β [... | {"source_file": "newjson.md"} | [
0.010099489241838455,
0.07505887001752853,
0.04259680211544037,
0.03790176659822464,
-0.08234277367591858,
0.006645273882895708,
0.013022559694945812,
-0.020778780803084373,
-0.03799441456794739,
-0.0338546521961689,
-0.021633485332131386,
0.0034803356975317,
-0.015897218137979507,
0.03533... |
e9a8ea61-04b2-4087-a128-5ac8f34fcd48 | We can avoid writing
Array(JSON)
sub-column names using a special syntax:
sql title="Query"
SELECT json.a.b[].c, json.a.b[].f, json.a.b[].d FROM test;
text title="Response"
ββjson.a.b.:`Array(JSON)`.cββ¬βjson.a.b.:`Array(JSON)`.fββββββββββββββββββββββββββββββββββββ¬βjson.a.b.:`Array(JSON)`.dββ
β [42,43,NULL] ... | {"source_file": "newjson.md"} | [
-0.002798703731968999,
0.047245126217603683,
0.020103951916098595,
0.03986118361353874,
-0.06846603006124496,
-0.06253987550735474,
0.012194320559501648,
0.013295543380081654,
-0.033680349588394165,
-0.02484164386987686,
0.00016194066847674549,
0.0053989579901099205,
0.03411538526415825,
-... |
6b001638-9f26-45f2-bd6a-3e2a0f14fcb2 | Handling JSON keys with NULL {#handling-json-keys-with-nulls}
In our JSON implementation
null
and absence of the value are considered equivalent:
sql title="Query"
SELECT '{}'::JSON AS json1, '{"a" : null}'::JSON AS json2, json1 = json2
text title="Response"
ββjson1ββ¬βjson2ββ¬βequals(json1, json2)ββ
β {} β {}... | {"source_file": "newjson.md"} | [
-0.08201946318149567,
0.03039463609457016,
-0.002753633074462414,
0.056134551763534546,
-0.06998197734355927,
-0.07865738123655319,
-0.020576151087880135,
-0.02150259166955948,
0.04819517582654953,
-0.03708275035023689,
0.0673581212759018,
-0.00405447743833065,
0.04165506362915039,
0.02938... |
0e990d98-af79-4f05-96a2-5a0c196f5f83 | sql title="Query"
SET json_type_escape_dots_in_keys=1;
SELECT '{"a.b" : 42, "a" : {"b" : "Hello World!"}}'::JSON AS json, JSONAllPaths(json);
text title="Response"
ββjsonβββββββββββββββββββββββββββββββββββ¬βJSONAllPaths(json)ββ
β {"a.b":"42","a":{"b":"Hello World!"}} β ['a%2Eb','a.b'] β
ββββββββββββββββββββββββββββ... | {"source_file": "newjson.md"} | [
-0.006219016388058662,
-0.0032620278652757406,
0.025204330682754517,
0.06201903522014618,
-0.0928366482257843,
-0.02238069660961628,
0.03695230185985565,
0.03709651529788971,
-0.01889176294207573,
-0.03132815659046173,
0.04339611530303955,
-0.0431072972714901,
0.08204127103090286,
-0.02900... |
5a84c691-a0ba-410f-9359-5eab5d742c6a | Reading JSON type from data {#reading-json-type-from-data}
All text formats
(
JSONEachRow
,
TSV
,
CSV
,
CustomSeparated
,
Values
, etc.) support reading the
JSON
type.
Examples:
sql title="Query"
SELECT json FROM format(JSONEachRow, 'json JSON(a.b.c UInt32, SKIP a.b.d, SKIP d.e, SKIP REGEXP \'b.*\')', '
{"j... | {"source_file": "newjson.md"} | [
-0.00666111009195447,
0.02209337055683136,
0.04825125262141228,
0.021985821425914764,
-0.053593095391988754,
0.04570677503943443,
0.0029657594859600067,
0.02312120422720909,
-0.023013940081000328,
-0.00600752979516983,
-0.06515558063983917,
0.016825782135128975,
-0.009337850846350193,
0.04... |
2333b9b5-7377-43a0-8ff8-c3788b608fa0 | When the limit is reached, all new paths inserted to a
JSON
column will be stored in a single shared data structure.
It's still possible to read such paths as sub-columns,
but it might be less efficient (
see section about shared data
).
This limit is needed to avoid having an enormous number of different sub-colu... | {"source_file": "newjson.md"} | [
-0.016477059572935104,
-0.10027426481246948,
-0.02194834128022194,
0.013469650410115719,
-0.05650930106639862,
-0.08447276055812836,
-0.10396029055118561,
0.025609562173485756,
0.006136227864772081,
-0.02737918123602867,
0.003128058509901166,
0.0385860875248909,
-0.003181896870955825,
0.04... |
f26d9438-28d7-44ca-aa63-ce4bae94fa17 | Let's see an example of such a merge.
First, let's create a table with a
JSON
column, set the limit of dynamic paths to
3
and then insert values with
5
different paths:
sql title="Query"
CREATE TABLE test (id UInt64, json JSON(max_dynamic_paths=3)) ENGINE=MergeTree ORDER BY id;
SYSTEM STOP MERGES test;
INSERT ... | {"source_file": "newjson.md"} | [
-0.0006513818516395986,
-0.04324515536427498,
-0.0037644226104021072,
0.02725774049758911,
-0.12773534655570984,
-0.03289324790239334,
-0.06140749156475067,
0.030242707580327988,
-0.00854962132871151,
-0.011064518243074417,
0.03555389866232872,
0.04294747859239578,
0.02404428832232952,
-0.... |
8f871dd0-0338-4f8d-b091-9b643e7db74d | Shared data structure in MergeTree parts {#shared-data-structure-in-merge-tree-parts}
In
MergeTree
tables we store data in data parts that stores everything on disk (local or remote). And data on disk can be stored in a different way compared to memory.
Currently, there are 3 different shared data structure seriali... | {"source_file": "newjson.md"} | [
0.05210445448756218,
-0.0005253545241430402,
0.013253691606223583,
-0.010495327413082123,
-0.028987636789679527,
-0.0802396759390831,
-0.103957399725914,
0.03933832421898842,
-0.0051394738256931305,
-0.013418580405414104,
0.032222479581832886,
0.028202606365084648,
-0.01766456477344036,
-0... |
fa5f8bf5-e453-468a-babd-584d87faa0ee | map
and
map_with_buckets
serializations.
For more detailed overview of the new shared data serializations and implementation details read the
blog post
.
Introspection functions {#introspection-functions}
There are several functions that can help to inspect the content of the JSON column:
-
JSONAllPaths
- ... | {"source_file": "newjson.md"} | [
-0.027512917295098305,
0.004834307823330164,
-0.04056108742952347,
-0.04542399197816849,
0.0198564063757658,
0.003167802467942238,
-0.08666236698627472,
-0.06895044445991516,
-0.013660455122590065,
-0.01721614971756935,
0.05049055069684982,
0.010427698493003845,
-0.02122317999601364,
-0.05... |
805956e7-f98b-42b1-9152-9347e2044e1f | text title="Response"
ββarrayJoin(distinctJSONPaths(json))ββββββββββββββββββββββββββ
β actor.avatar_url β
β actor.display_login β
β actor.gravatar_id β
β actor.id ... | {"source_file": "newjson.md"} | [
-0.09858664870262146,
-0.012022150680422783,
0.026886846870183945,
0.05863935127854347,
0.05672036111354828,
-0.04873364418745041,
0.007943038828670979,
-0.03549285978078842,
0.07102283090353012,
0.03605862706899643,
0.03987180441617966,
-0.008838037960231304,
0.047488074749708176,
0.04775... |
4b74c7aa-a30b-4346-b0b5-8074869859d8 | β payload.size β
β public β
β repo.id β
β repo.name β
β repo.url β
β typ... | {"source_file": "newjson.md"} | [
-0.060591354966163635,
-0.0022421707399189472,
0.0005447526345960796,
-0.00627388758584857,
0.014891470782458782,
-0.045121826231479645,
-0.010540826246142387,
-0.015153122134506702,
0.05704902857542038,
-0.02698882296681404,
0.08452948927879333,
0.03773409128189087,
-0.01697457954287529,
... |
d78e86c1-d9cd-4b4d-8a7b-d098c28e2355 | sql
SELECT arrayJoin(distinctJSONPathsAndTypes(json))
FROM s3('s3://clickhouse-public-datasets/gharchive/original/2020-01-01-*.json.gz', JSONAsObject)
SETTINGS date_time_input_format = 'best_effort' | {"source_file": "newjson.md"} | [
-0.02439855970442295,
-0.012384682893753052,
-0.06944979727268219,
0.01379842683672905,
-0.036701321601867676,
0.041163332760334015,
-0.013884839601814747,
-0.06434711813926697,
-0.02267719805240631,
-0.01673329994082451,
-0.010822287760674953,
-0.017667584121227264,
0.02534826099872589,
-... |
43e2523d-5d1a-4272-8496-c60ca4a1529c | text
ββarrayJoin(distinctJSONPathsAndTypes(json))βββββββββββββββββββ
β ('actor.avatar_url',['String']) β
β ('actor.display_login',['String']) β
β ('actor.gravatar_id',['String']) β
β ('actor.id',['Int64']) ... | {"source_file": "newjson.md"} | [
-0.010040602646768093,
0.04197217524051666,
0.004842633381485939,
-0.03334542363882065,
0.007786232978105545,
-0.007818667218089104,
0.048521000891923904,
-0.03674664720892906,
0.04675062745809555,
-0.009732676669955254,
0.08276066929101944,
0.00020753618446178734,
0.03965117782354355,
0.0... |
107f4b92-85c2-4e0c-8222-c327e90c1ef9 | β ('payload.release.zipball_url',['String']) β
β ('payload.size',['Int64']) β
β ('public',['Bool']) β
β ('repo.id',['Int64']) β
β ('repo.name',['String']) β
... | {"source_file": "newjson.md"} | [
-0.03475895896553993,
0.05924805626273155,
0.0048246001824736595,
0.0021298914216458797,
0.02661341428756714,
-0.03889605402946472,
0.02941226027905941,
-0.02082432247698307,
0.03147099167108536,
-0.016718123108148575,
0.06082276254892349,
0.04457452520728111,
0.00434378394857049,
0.055105... |
13897bb2-fffc-4e1d-9493-9445908950a1 | ALTER MODIFY COLUMN to JSON type {#alter-modify-column-to-json-type}
It's possible to alter an existing table and change the type of the column to the new
JSON
type. Right now only
ALTER
from a
String
type is supported.
Example
sql title="Query"
CREATE TABLE test (json String) ENGINE=MergeTree ORDER BY tupl... | {"source_file": "newjson.md"} | [
-0.002446918049827218,
0.01358486246317625,
0.0544775053858757,
0.031110314652323723,
-0.0946258008480072,
0.014873047359287739,
-0.05466057360172272,
-0.0011127232573926449,
-0.030736029148101807,
0.03672467917203903,
0.04320438206195831,
0.008787690661847591,
-0.03688822686672211,
-0.003... |
930909f1-cb0a-478d-a6b8-bf53b8205ef5 | Note:
when 2 paths contain values of different data types, they are compared according to
comparison rule
of
Variant
data type.
Tips for better usage of the JSON type {#tips-for-better-usage-of-the-json-type}
Before creating
JSON
column and loading data into it, consider the following tips:
Investigate y... | {"source_file": "newjson.md"} | [
-0.019977547228336334,
0.04074791446328163,
-0.015963783487677574,
0.029888728633522987,
-0.0522594191133976,
-0.07936481386423111,
-0.08975851535797119,
0.05399774760007858,
0.0027195573784410954,
-0.022244447842240334,
0.02563115581870079,
0.01711047999560833,
-0.016444537788629532,
0.06... |
35d086a2-1b56-467e-a43c-24bd2c3295f9 | description: 'Documentation for the Time64 data type in ClickHouse, which stores
the time range with sub-second precision'
slug: /sql-reference/data-types/time64
sidebar_position: 17
sidebar_label: 'Time64'
title: 'Time64'
doc_type: 'reference'
Time64
Data type
Time64
represents a time-of-day with fractional ... | {"source_file": "time64.md"} | [
0.026513149961829185,
0.008111568167805672,
-0.0860912948846817,
0.03769129887223244,
-0.06283459067344666,
-0.0002702775236684829,
-0.052372366189956665,
0.04486658051609993,
-0.007966438308358192,
-0.01656527817249298,
-0.0009259008220396936,
-0.03856736049056053,
-0.029851486906409264,
... |
41ed3ba8-64a7-4adb-8848-538b49aab0be | text
ββevent_idββ¬ββββββββtimeββ
1. β 1 β 14:30:25.000 β
2. β 2 β 14:30:25.123 β
3. β 3 β 14:30:25.000 β
ββββββββββββ΄βββββββββββββββ
Filtering on
Time64
values
sql
SELECT * FROM tab64 WHERE time = toTime64('14:30:25', 3);
text
ββevent_idββ¬ββββββββtimeββ
1. β 1 β 14:30:25.... | {"source_file": "time64.md"} | [
0.07069514691829681,
0.03147388622164726,
0.020481381565332413,
0.014068391174077988,
-0.021637987345457077,
-0.007492732256650925,
0.0587456114590168,
0.033748943358659744,
0.022084830328822136,
-0.008141591213643551,
-0.008467426523566246,
-0.06737446784973145,
-0.011693385429680347,
-0.... |
9540e112-89ca-4920-bb93-a0ccd454ac67 | description: 'Documentation for floating-point data types in ClickHouse: Float32,
Float64, and BFloat16'
sidebar_label: 'Float32 | Float64 | BFloat16'
sidebar_position: 4
slug: /sql-reference/data-types/float
title: 'Float32 | Float64 | BFloat16 Types'
doc_type: 'reference'
:::note
If you need accurate calculatio... | {"source_file": "float.md"} | [
0.006354986224323511,
-0.044787634164094925,
-0.04095885530114174,
-0.0029330092947930098,
-0.06835067272186279,
-0.07678676396608353,
0.050396498292684555,
0.042451195418834686,
-0.021171431988477707,
0.029609132558107376,
-0.019904732704162598,
-0.12456356734037399,
0.018310368061065674,
... |
ce7d9a79-11b4-43d9-89ce-685f4f2aed8b | NaN
β Not a number.
```sql
SELECT 0 / 0
ββdivide(0, 0)ββ
β nan β
ββββββββββββββββ
```
See the rules for
NaN
sorting in the section
ORDER BY clause
.
BFloat16 {#bfloat16}
BFloat16
is a 16-bit floating point data type with 8-bit exponent, sign, and 7-bit mantissa.
It is useful for machine lea... | {"source_file": "float.md"} | [
0.01909090392291546,
-0.026038747280836105,
-0.015274680219590664,
-0.040683355182409286,
-0.0020644241012632847,
-0.09579147398471832,
0.04968072101473808,
-0.016757821664214134,
-0.013246591202914715,
0.059122055768966675,
0.049565281718969345,
0.02379531040787697,
-0.019099269062280655,
... |
6adc2803-484c-42b2-ad30-9aa7bc5c89c4 | description: 'Documentation for Aggregate Function Combinators'
sidebar_label: 'Combinators'
sidebar_position: 37
slug: /sql-reference/aggregate-functions/combinators
title: 'Aggregate Function Combinators'
doc_type: 'reference'
Aggregate function combinators
The name of an aggregate function can have a suffix ap... | {"source_file": "combinators.md"} | [
-0.08445394039154053,
-0.01358684990555048,
0.08510114252567291,
0.03035399504005909,
-0.04084990546107292,
0.034982167184352875,
0.03297344967722893,
0.0816655233502388,
0.053403183817863464,
-0.013987264595925808,
0.0339706726372242,
-0.05929664149880409,
0.04652177169919014,
-0.05906050... |
8767cff2-bb1f-43f2-a098-f2c0258241bd | SELECT
timeslot,
sumMap(status),
avgMap(status),
minMap(status)
FROM map_map
GROUP BY timeslot;
βββββββββββββtimeslotββ¬βsumMap(status)ββββββββββββββββββββββββ¬βavgMap(status)ββββββββββββββββββββββββ¬βminMap(status)ββββββββββββββββββββββββ
β 2000-01-01 00:00:00 β {'a':10,'b':10,'c':20,'d':10,'e':10} β {'... | {"source_file": "combinators.md"} | [
0.04628933221101761,
0.059686072170734406,
0.08573166280984879,
-0.02685951441526413,
-0.020322781056165695,
0.04027894511818886,
0.04638965055346489,
-0.029508188366889954,
-0.08019157499074936,
0.07175389677286148,
0.08717550337314606,
-0.07348541170358658,
-0.01798277534544468,
-0.01027... |
a3f584f8-6353-4fd2-9395-6c23c7a18fb3 | -Distinct {#-distinct}
Every unique combination of arguments will be aggregated only once. Repeating values are ignored.
Examples:
sum(DISTINCT x)
(or
sumDistinct(x)
),
groupArray(DISTINCT x)
(or
groupArrayDistinct(x)
),
corrStable(DISTINCT x, y)
(or
corrStableDistinct(x, y)
) and so on.
-OrDefault {#-orde... | {"source_file": "combinators.md"} | [
-0.04828469827771187,
-0.051364459097385406,
0.00854199193418026,
0.04803919047117233,
-0.07565457373857498,
0.03884238377213478,
0.09236833453178406,
-0.031524233520030975,
0.07947032153606415,
-0.05398542061448097,
0.010831178165972233,
0.033836521208286285,
0.028883660212159157,
-0.0619... |
55bf81cc-deea-4c85-a23e-d2b811309bc8 | sql
<aggFunction>Resample(start, end, step)(<aggFunction_params>, resampling_key)
Arguments
start
β Starting value of the whole required interval for
resampling_key
values.
stop
β Ending value of the whole required interval for
resampling_key
values. The whole interval does not include the
stop
value
[... | {"source_file": "combinators.md"} | [
-0.05066920071840286,
0.007787075825035572,
0.047537434846162796,
0.005264601670205593,
-0.03387711942195892,
-0.04395332932472229,
0.016368385404348373,
0.029515549540519714,
-0.07187877595424652,
-0.02678532525897026,
0.0077169244177639484,
-0.030281564220786095,
-0.010047721676528454,
-... |
0fdbc9c7-10b1-446a-8e68-a641f96e236a | description: 'Documentation for Parametric Aggregate Functions'
sidebar_label: 'Parametric'
sidebar_position: 38
slug: /sql-reference/aggregate-functions/parametric-functions
title: 'Parametric Aggregate Functions'
doc_type: 'reference'
Parametric aggregate functions
Some aggregate functions can accept not only a... | {"source_file": "parametric-functions.md"} | [
0.031178046017885208,
-0.025398077443242073,
-0.0890149474143982,
-0.03192514926195145,
-0.10737094283103943,
-0.00785915832966566,
0.00415450893342495,
0.0819181427359581,
-0.09130049496889114,
0.020519228652119637,
-0.014598098583519459,
-0.01599034294486046,
0.143093079328537,
-0.095826... |
6150def9-4af9-4b67-9202-942e1768fef8 | Arguments
timestamp
β Column considered to contain time data. Typical data types are
Date
and
DateTime
. You can also use any of the supported
UInt
data types.
cond1
,
cond2
β Conditions that describe the chain of events. Data type:
UInt8
. You can pass up to 32 condition arguments. The function ta... | {"source_file": "parametric-functions.md"} | [
-0.09760031849145889,
0.07916512340307236,
0.026121297851204872,
-0.023025065660476685,
-0.025557950139045715,
-0.013081771321594715,
0.06589677929878235,
0.03623286634683609,
0.0033633222337812185,
-0.05551622435450554,
-0.006309247575700283,
-0.08747823536396027,
-0.057587072253227234,
-... |
728f8439-628a-47d6-8d84-c2a8241073ec | sql
SELECT sequenceMatch('(?1)(?2)')(time, number = 1, number = 2, number = 4) FROM t
text
ββsequenceMatch('(?1)(?2)')(time, equals(number, 1), equals(number, 2), equals(number, 4))ββ
β 1 β
βββββββββββββββββββββββββββββββββββββββββ... | {"source_file": "parametric-functions.md"} | [
-0.06650883704423904,
-0.012952846474945545,
0.04135805740952492,
-0.014353025704622269,
-0.019431978464126587,
-0.001780024846084416,
0.055362313985824585,
0.010553665459156036,
0.060165517032146454,
-0.036347612738609314,
0.044653672724962234,
-0.05262454226613045,
0.0008942378335632384,
... |
59dfa1e3-05e1-42ab-a26b-cf18ff62497b | Parameters
pattern
β Pattern string. See
Pattern syntax
.
Returned values
Array of timestamps for matched condition arguments (?N) from event chain. Position in array match position of condition argument in pattern
Type: Array.
Example
Consider data in the
t
table:
text
ββtimeββ¬βnumberββ
β ... | {"source_file": "parametric-functions.md"} | [
-0.05484402924776077,
0.0084781963378191,
0.03112325631082058,
-0.04115396738052368,
-0.04058444872498512,
-0.011787334457039833,
0.048123799264431,
0.021337496116757393,
0.040057115256786346,
-0.033994659781455994,
-0.017765222117304802,
0.031372006982564926,
-0.00774800218641758,
-0.0269... |
a601e00e-f2e9-4cb4-a593-7c79c229cb0a | 'strict_increase'
β Apply conditions only to events with strictly increasing timestamps.
'strict_once'
β Count each event only once in the chain even if it meets the condition several times
Returned value
The maximum number of consecutive triggered conditions from the chain within the sliding time window.
All... | {"source_file": "parametric-functions.md"} | [
-0.07910408079624176,
0.02561897411942482,
0.0916919931769371,
-0.022677797824144363,
-0.04303523898124695,
0.02252724952995777,
0.04832705855369568,
0.02249484695494175,
0.07908105105161667,
-0.036168962717056274,
0.0784340649843216,
-0.007078992202877998,
0.04181566461920738,
-0.03577636... |
4a8ee86f-5dea-4c43-8d25-accac1fa1dc4 | Type:
UInt8
.
Example
Let's consider an example of calculating the
retention
function to determine site traffic.
1.
Create a table to illustrate an example.
```sql
CREATE TABLE retention_test(date Date, uid Int32) ENGINE = Memory;
INSERT INTO retention_test SELECT '2020-01-01', number FROM numbers(5);
INS... | {"source_file": "parametric-functions.md"} | [
0.01360801886767149,
-0.027433620765805244,
-0.09585660696029663,
0.0760173499584198,
-0.05971302464604378,
-0.03078112006187439,
0.09470877051353455,
0.023341549560427666,
0.011312734335660934,
0.020945405587553978,
0.06212397664785385,
-0.05269678309559822,
0.021216141059994698,
-0.02215... |
e69e596a-cd8f-4131-9429-56e71a5e6882 | r3
- the number of unique visitors who visited the site during a specific time period on 2020-01-01 and 2020-01-03 (
cond1
and
cond3
conditions).
uniqUpTo(N)(x) {#uniquptonx}
Calculates the number of different values of the argument up to a specified limit,
N
. If the number of different argument values is gr... | {"source_file": "parametric-functions.md"} | [
-0.06721141189336777,
-0.04667454957962036,
-0.10875240713357925,
0.05828819051384926,
0.006059554405510426,
0.0005264972569420934,
0.052116844803094864,
0.06206471472978592,
0.058362118899822235,
-0.023946208879351616,
-0.01668594777584076,
0.03918110951781273,
0.08519631624221802,
-0.017... |
b019dab7-d9b8-48e0-be44-1e996c36dde4 | sumMapFilteredWithOverflow {#summapfilteredwithoverflow}
This function behaves the same as
sumMap
except that it also accepts an array of keys to filter with as a parameter. This can be especially useful when working with a high cardinality of keys. It differs from the
sumMapFiltered
function in that it does summ... | {"source_file": "parametric-functions.md"} | [
-0.015302478335797787,
0.028916196897625923,
0.05312079191207886,
0.012210896238684654,
-0.031336601823568344,
-0.027939684689044952,
0.030730685219168663,
-0.01883259043097496,
-0.028371818363666534,
0.032393425703048706,
-0.05609497055411339,
-0.06363784521818161,
0.005274656228721142,
-... |
62a12385-e4d8-4475-991d-9d5b8ff2aa4a | head β Set the base point to the first event.
tail β Set the base point to the last event.
first_match β Set the base point to the first matched
event1
.
last_match β Set the base point to the last matched
event1
.
Arguments
timestamp
β Name of the column containing the timestamp. Data types supported:... | {"source_file": "parametric-functions.md"} | [
-0.02649686671793461,
0.03461459279060364,
-0.006116076372563839,
-0.015667004510760307,
-0.014963606372475624,
0.018593454733490944,
0.06526947021484375,
0.048424627631902695,
0.018127519637346268,
0.01780240796506405,
0.023717932403087616,
-0.07194893807172775,
-0.03768577054142952,
-0.0... |
faddc61c-1260-4905-9130-a5ca5f201da4 | dt id page
1970-01-01 09:00:01 1 Home
1970-01-01 09:00:02 1 Gift
1970-01-01 09:00:03 1 Exit // Base point, Unmatched with Basket
1970-01-01 09:00:01 2 Home
1970-01-01 09:00:02 2 Home // The result
1970-01-01 09:00:03 2 Gift // Matched with Gift
1970-01-01 09:00:04 2 Basket //... | {"source_file": "parametric-functions.md"} | [
-0.09375675767660141,
0.032010845839977264,
0.06552303582429886,
0.0035362697672098875,
0.012406407855451107,
0.06599237769842148,
0.0473208911716938,
-0.06860794872045517,
0.07923686504364014,
-0.01508815586566925,
0.03589198738336563,
-0.023456523194909096,
-0.024213038384914398,
-0.0358... |
0bfb2a79-dcbb-494f-9c85-966f1cd474a3 | dt id page
1970-01-01 09:00:01 1 Home // Matched with Home, the result is null
1970-01-01 09:00:02 1 Gift // Base point
1970-01-01 09:00:03 1 Exit
1970-01-01 09:00:01 2 Home // The result
1970-01-01 09:00:02 2 Home // Matched with Home
1970-01-01 09:00:03 2 Gift // Base point
1970... | {"source_file": "parametric-functions.md"} | [
-0.033724792301654816,
0.03811728209257126,
0.06248675659298897,
-0.011273924261331558,
0.008858166635036469,
0.035752590745687485,
0.041406724601984024,
0.012923392467200756,
0.02294512465596199,
0.010163022205233574,
0.041574444621801376,
-0.0803462341427803,
-0.03147544711828232,
-0.036... |
e5c2b763-880f-4b60-aa49-cd33443d4e1a | description: 'Documentation for Aggregate Functions'
sidebar_label: 'Aggregate Functions'
sidebar_position: 33
slug: /sql-reference/aggregate-functions/
title: 'Aggregate Functions'
doc_type: 'reference'
Aggregate functions
Aggregate functions work in the
normal
way as expected by database experts.
ClickHouse... | {"source_file": "index.md"} | [
-0.05102267488837242,
-0.03708165884017944,
0.0023803848307579756,
0.013480504974722862,
-0.06309014558792114,
0.016328755766153336,
-0.007124497555196285,
0.02721349708735943,
0.007138578686863184,
0.006811202969402075,
0.07497380673885345,
-0.038577850908041,
0.04819997027516365,
-0.1188... |
07756ed3-fac0-418d-8233-8c24b5c5f3e9 | ```sql
SELECT
v,
count(1),
count(v)
FROM
(
SELECT if(number < 10, NULL, number % 3) AS v
FROM numbers(15)
)
GROUP BY v
βββββvββ¬βcount()ββ¬βcount(v)ββ
β α΄Ία΅α΄Έα΄Έ β 10 β 0 β
β 0 β 1 β 1 β
β 1 β 2 β 2 β
β 2 β 2 β 2 β
ββββββββ΄ββββββββββ΄βββββββββββ... | {"source_file": "index.md"} | [
-0.012347816489636898,
-0.023409655317664146,
0.017546216025948524,
-0.024029629305005074,
0.028933770954608917,
-0.010102575644850731,
0.011075686663389206,
-0.005301650147885084,
-0.07988511770963669,
0.01307635847479105,
0.0772099643945694,
-0.014634245075285435,
-0.014184079132974148,
... |
f76b9f50-924a-4c02-9748-afcfd8188ade | description: 'Documentation for the GROUPING aggregate function.'
slug: /sql-reference/aggregate-functions/grouping_function
title: 'GROUPING'
doc_type: 'reference'
GROUPING
GROUPING {#grouping}
ROLLUP
and
CUBE
are modifiers to GROUP BY. Both of these calculate subtotals. ROLLUP takes an ordered list of colu... | {"source_file": "grouping_function.md"} | [
-0.0571308396756649,
-0.011503892950713634,
-0.04833154380321503,
0.06485171616077423,
-0.03516406938433647,
-0.025870298966765404,
-0.024350643157958984,
0.010888301767408848,
0.012726003304123878,
-0.059518083930015564,
-0.002187528880313039,
0.017388030886650085,
-0.0038493184838443995,
... |
17ee068d-4517-41a6-acc3-2e18b875464a | 10 rows in set. Elapsed: 0.409 sec.
```
Simple queries {#simple-queries}
Get the count of servers in each data center by distribution:
sql
SELECT
datacenter,
distro,
SUM (quantity) qty
FROM
servers
GROUP BY
datacenter,
distro;
```response
ββdatacenterβββ¬βdistroββ¬βqtyββ
β Schenectady β RH... | {"source_file": "grouping_function.md"} | [
0.04862501844763756,
-0.05006156116724014,
-0.001301249605603516,
0.0423935130238533,
-0.11377452313899994,
-0.044394601136446,
0.022607527673244476,
-0.00984244979918003,
0.047115158289670944,
0.06269446760416031,
0.06597212702035904,
-0.09247991442680359,
0.04159814864397049,
-0.06948207... |
a83e7df2-4bb6-4c92-a37d-2506d214b781 | sql
SELECT
datacenter,
distro,
SUM (quantity) qty
FROM
servers
GROUP BY
GROUPING SETS(
(datacenter,distro),
(datacenter),
(distro),
()
)
```response
ββdatacenterβββ¬βdistroββ¬βqtyββ
β Schenectady β RHEL β 140 β
β Westport β Arch β 65 β
β Schenectady β Arch... | {"source_file": "grouping_function.md"} | [
0.042143564671278,
-0.07172245532274246,
-0.01509298849850893,
0.00835577305406332,
-0.011361829936504364,
-0.06279551982879639,
-0.06254994124174118,
-0.013958804309368134,
0.024025525897741318,
-0.025339215993881226,
0.02818036824464798,
-0.043664298951625824,
0.025033317506313324,
-0.06... |
3ed9831d-f152-4ee2-8c44-f3a61ccf77ac | sql
SELECT
datacenter,
distro,
version,
SUM(quantity)
FROM
servers
GROUP BY
CUBE(datacenter,distro,version)
ORDER BY
datacenter,
distro;
```response
ββdatacenterβββ¬βdistroββ¬βversionβββββ¬βsum(quantity)ββ
β β β 7 β 160 β
β β β 2020.05.01 β ... | {"source_file": "grouping_function.md"} | [
0.02167668752372265,
-0.0675477609038353,
0.006493589840829372,
0.08259879052639008,
-0.04828042909502983,
-0.053128235042095184,
-0.01973990723490715,
-0.04922597482800484,
-0.044461384415626526,
0.059313591569662094,
0.022898666560649872,
-0.04927815496921539,
0.029244203120470047,
-0.07... |
c4fdb615-a49e-4b6c-ba65-3c1d50fdc82f | sql
SELECT
datacenter,
distro,
version,
SUM(quantity)
FROM servers
GROUP BY
GROUPING SETS (
(datacenter, distro, version),
(datacenter, distro))
```response
ββdatacenterβββ¬βdistroββ¬βversionβββββ¬βsum(quantity)ββ
β Westport β RHEL β 9 β 70 β
β Schenectady β Ar... | {"source_file": "grouping_function.md"} | [
0.04024304822087288,
-0.0634971559047699,
0.03680223971605301,
0.04947282001376152,
-0.03853614628314972,
-0.041899316012859344,
0.0046757906675338745,
-0.04270574823021889,
-0.06322649866342545,
0.05636202543973923,
0.04040684551000595,
-0.07487668842077255,
0.027447381988167763,
-0.07640... |
d7667b95-f9d6-47c6-bb9c-6ccc48997f41 | description: 'Documentation for INSERT INTO Statement'
sidebar_label: 'INSERT INTO'
sidebar_position: 33
slug: /sql-reference/statements/insert-into
title: 'INSERT INTO Statement'
doc_type: 'reference'
INSERT INTO Statement
Inserts data into a table.
Syntax
sql
INSERT INTO [TABLE] [db.]table [(c1, c2, c3)] [S... | {"source_file": "insert-into.md"} | [
0.052840519696474075,
0.022144021466374397,
-0.017923478037118912,
0.018466714769601822,
-0.04995306208729744,
0.04416169971227646,
-0.007064645178616047,
0.0528264045715332,
-0.07339144498109818,
0.05235506221652031,
0.07145821303129196,
-0.05748070776462555,
0.10542237013578415,
-0.13519... |
bf65d12a-9037-4ca5-89b7-97b2feff6926 | sql
INSERT INTO table SETTINGS ... FORMAT format_name data_set
:::
Constraints {#constraints}
If a table has
constraints
, their expressions will be checked for each row of inserted data. If any of those constraints is not satisfied β the server will raise an exception containing the constraint name and expressio... | {"source_file": "insert-into.md"} | [
-0.02504388988018036,
-0.02794579043984413,
-0.010213907808065414,
0.03826669231057167,
-0.06481797248125076,
0.020464854314923286,
0.007873856462538242,
0.0020914925262331963,
-0.03295363858342171,
0.03324832767248154,
0.042238086462020874,
-0.010778052732348442,
0.08587578684091568,
-0.0... |
3212c256-fb9c-4c5e-bd09-c3e4b3716380 | Result:
text
ββidββ¬βtextββ
β 1 β A β
β 2 β B β
ββββββ΄βββββββ
Multiple files with FROM INFILE using globs {#multiple-files-with-from-infile-using-globs}
This example is very similar to the previous one but inserts are performed from multiple files using
FROM INFILE 'input_*.csv
.
bash
echo 1,A > input_1... | {"source_file": "insert-into.md"} | [
0.006126462947577238,
-0.039937835186719894,
-0.03964638337492943,
0.041132595390081406,
-0.02186758816242218,
-0.02873852103948593,
0.06675045937299728,
0.05226292088627815,
-0.016413625329732895,
0.02301597036421299,
0.05023734271526337,
0.012852170504629612,
0.12638629972934723,
-0.0872... |
e520d19a-6140-4f17-b845-8f781db7e527 | Inserting into a replicated setup {#inserting-into-a-replicated-setup}
In a replicated setup, data will be visible on other replicas after it has been replicated. Data begins being replicated (downloaded on other replicas) immediately after an
INSERT
. This differs from ClickHouse Cloud, where data is immediately wr... | {"source_file": "insert-into.md"} | [
-0.06890955567359924,
-0.07508682459592819,
-0.06294962018728256,
0.014048812910914421,
-0.00986938364803791,
-0.0404958501458168,
-0.0626102164387703,
-0.044961269944906235,
0.052132315933704376,
0.04427969455718994,
0.03940495103597641,
0.06982837617397308,
0.15266269445419312,
-0.071431... |
8ee97955-445c-4889-a733-7fe18229c529 | description: 'Documentation for MOVE access entity statement'
sidebar_label: 'MOVE'
sidebar_position: 54
slug: /sql-reference/statements/move
title: 'MOVE access entity statement'
doc_type: 'reference'
MOVE access entity statement
This statement allows to move an access entity from one access storage to another.
... | {"source_file": "move.md"} | [
0.04636600241065025,
-0.05243412032723427,
-0.1078767329454422,
0.08291307091712952,
-0.01925220899283886,
0.011533885262906551,
0.08863726258277893,
-0.02440451830625534,
-0.06993663311004639,
0.039561424404382706,
0.07415184378623962,
0.022871287539601326,
0.08641280978918076,
-0.0527945... |
e30dbfe6-dd7e-4416-a733-d05a7e2c8cb0 | description: 'Documentation for REVOKE Statement'
sidebar_label: 'REVOKE'
sidebar_position: 39
slug: /sql-reference/statements/revoke
title: 'REVOKE Statement'
doc_type: 'reference'
REVOKE Statement
Revokes privileges from users or roles.
Syntax {#syntax}
Revoking privileges from users
sql
REVOKE [ON CLUSTE... | {"source_file": "revoke.md"} | [
0.015347359701991081,
0.11338657885789871,
0.012573068030178547,
0.07270044088363647,
-0.01433026883751154,
0.00016552931629121304,
0.10567492991685867,
-0.034720320254564285,
-0.03525957465171814,
-0.01657436601817608,
0.012401164509356022,
-0.003582349978387356,
0.10100369155406952,
-0.0... |
9a318e68-568f-45c2-bf28-bc3c7639a911 | description: 'Documentation for GRANT Statement'
sidebar_label: 'GRANT'
sidebar_position: 38
slug: /sql-reference/statements/grant
title: 'GRANT Statement'
doc_type: 'reference'
import CloudNotSupportedBadge from '@theme/badges/CloudNotSupportedBadge';
GRANT Statement
Grants
privileges
to ClickHouse user ac... | {"source_file": "grant.md"} | [
0.016579579561948776,
0.050914350897073746,
0.03038513846695423,
0.05971866473555565,
-0.027154522016644478,
0.07841874659061432,
0.10420424491167068,
-0.07321308553218842,
-0.042591579258441925,
0.006108563859015703,
-0.039118897169828415,
-0.07134359329938889,
0.11561163514852524,
-0.020... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.