id stringlengths 36 36 | document stringlengths 3 3k | metadata stringlengths 23 69 | embeddings listlengths 384 384 |
|---|---|---|---|
1a93b79d-931f-420b-af08-13b30c215908 | toUInt32OrNull
.
toUInt64 {#touint64}
Converts an input value to a value of type
UInt64
. Throws an exception in case of an error.
Syntax
sql
toUInt64(expr)
Arguments
expr
β Expression returning a number or a string representation of a number.
Expression
.
Supported arguments:
- Values or string ... | {"source_file": "type-conversion-functions.md"} | [
0.0415244996547699,
-0.012093623168766499,
-0.05739172548055649,
0.031811781227588654,
-0.06776681542396545,
-0.006789781153202057,
0.05310248211026192,
0.047641072422266006,
-0.011248277500271797,
0.011018015444278717,
-0.03256290778517723,
-0.07865823060274124,
0.006854006089270115,
-0.0... |
446c25a4-ce89-4c56-b2e1-546f8224401b | :::note
If the input value cannot be represented within the bounds of
UInt64
, overflow or underflow of the result occurs.
This is not considered an error.
:::
Returned value
64-bit unsigned integer value if successful, otherwise
NULL
.
UInt64
/
NULL
.
:::note
The function uses
rounding towards zero
, m... | {"source_file": "type-conversion-functions.md"} | [
0.03731410577893257,
0.045551903545856476,
-0.08457765728235245,
0.029042473062872887,
-0.0907464250922203,
0.013633825816214085,
0.017343441024422646,
0.060158923268318176,
-0.017484761774539948,
0.012671234086155891,
0.026389187201857567,
-0.04689069092273712,
0.03733162209391594,
-0.027... |
c9ac4dfc-14e4-474a-9ccb-a916f1c0b969 | Unsupported arguments:
- String representations of Float32/64 values, including
NaN
and
Inf
.
- String representations of binary and hexadecimal values, e.g.
SELECT toUInt128('0xc0fe');
.
:::note
If the input value cannot be represented within the bounds of
UInt128
, the result over or under flows.
This is not c... | {"source_file": "type-conversion-functions.md"} | [
-0.03572045639157295,
-0.007452667690813541,
-0.09708590805530548,
-0.02224319614470005,
-0.0942721739411354,
-0.048024337738752365,
0.055887989699840546,
0.035430289804935455,
-0.029495490714907646,
-0.017798855900764465,
-0.0320611335337162,
-0.06672540307044983,
-0.02678872086107731,
-0... |
fa3d5df8-e27e-4fba-9cdf-cc739eb6ee19 | 128-bit unsigned integer value if successful, otherwise
NULL
.
UInt128
/
NULL
.
:::note
The function uses
rounding towards zero
, meaning it truncates fractional digits of numbers.
:::
Example
Query:
sql
SELECT
toUInt128OrNull('128'),
toUInt128OrNull('abc')
FORMAT Vertical;
Result:
response
R... | {"source_file": "type-conversion-functions.md"} | [
-0.014498609118163586,
0.0549965538084507,
-0.08489032089710236,
0.027604056522250175,
-0.09827534109354019,
0.02686283178627491,
0.06577225029468536,
0.08819124102592468,
-0.03384925797581673,
-0.01319891307502985,
-0.018349986523389816,
-0.049014341086149216,
0.013583197258412838,
-0.013... |
6e639616-20e7-47d7-9385-1aa9ec043d2d | :::note
If the input value cannot be represented within the bounds of
UInt256
, the result over or under flows.
This is not considered an error.
:::
Returned value
256-bit unsigned integer value.
Int256
.
:::note
The function uses
rounding towards zero
, meaning it truncates fractional digits of numbers.
:... | {"source_file": "type-conversion-functions.md"} | [
-0.014881783165037632,
-0.022871797904372215,
-0.08354609459638596,
0.028353579342365265,
-0.07354146987199783,
-0.06301148980855942,
0.06950099021196365,
0.005154894664883614,
-0.012802865356206894,
-0.028487352654337883,
-0.00962084624916315,
-0.04014132544398308,
0.010829021222889423,
-... |
c34a4be0-df25-4b0a-971a-0467259e43bd | Result:
response
Row 1:
ββββββ
toUInt256OrNull('256'): 256
toUInt256OrNull('abc'): α΄Ία΅α΄Έα΄Έ
See also
toUInt256
.
toUInt256OrZero
.
toUInt256OrDefault
.
toUInt256OrDefault {#touint256ordefault}
Like
toUInt256
, this function converts an input value to a value of type
UInt256
but returns the default valu... | {"source_file": "type-conversion-functions.md"} | [
-0.0015404478181153536,
-0.038038481026887894,
-0.08339665085077286,
0.04487711936235428,
-0.10096704959869385,
0.004359452053904533,
0.08062195032835007,
0.022679220885038376,
-0.05592004582285881,
0.0021005456801503897,
0.019452201202511787,
-0.06555657833814621,
0.042222145944833755,
-0... |
bcc36fe1-7c6d-4f7a-9a9b-8e23dbbfcb00 | See also
toFloat32OrZero
.
toFloat32OrNull
.
toFloat32OrDefault
.
toFloat32OrZero {#tofloat32orzero}
Like
toFloat32
, this function converts an input value to a value of type
Float32
but returns
0
in case of an error.
Syntax
sql
toFloat32OrZero(x)
Arguments
x
β A String representation of a... | {"source_file": "type-conversion-functions.md"} | [
0.05932240933179855,
-0.021244218572974205,
-0.108571857213974,
0.04274049028754234,
-0.04418244957923889,
-0.0026132476050406694,
0.05194547772407532,
0.03532138839364052,
-0.02788240648806095,
-0.024391787126660347,
-0.04887320101261139,
-0.1583203226327896,
0.021053120493888855,
0.02773... |
ee932918-5af0-4041-b99d-b9a2cb0ed291 | Returned value
32-bit Float value if successful, otherwise returns the default value if passed or
0
if not.
Float32
.
Example
Query:
sql
SELECT
toFloat32OrDefault('8', CAST('0', 'Float32')),
toFloat32OrDefault('abc', CAST('0', 'Float32'))
FORMAT Vertical;
Result:
response
Row 1:
ββββββ
toFloa... | {"source_file": "type-conversion-functions.md"} | [
0.04165717959403992,
-0.01137965265661478,
-0.09170440584421158,
0.051064129918813705,
-0.05275777354836464,
-0.025973951444029808,
0.07087831199169159,
0.04483768716454506,
-0.026055358350276947,
0.0016159198712557554,
-0.027674634009599686,
-0.12125419080257416,
0.0046236105263233185,
0.... |
7f633035-15a8-4218-af7d-c6e3e6fe6559 | Returned value
64-bit Float value if successful, otherwise
\N
.
Float64
.
Example
Query:
sql
SELECT
toFloat64OrNull('42.7'),
toFloat64OrNull('abc')
FORMAT Vertical;
Result:
response
Row 1:
ββββββ
toFloat64OrNull('42.7'): 42.7
toFloat64OrNull('abc'): α΄Ία΅α΄Έα΄Έ
See also
toFloat64
.
toFloat64... | {"source_file": "type-conversion-functions.md"} | [
0.047373753041028976,
0.011522959917783737,
-0.06971390545368195,
0.059470873326063156,
-0.05791525915265083,
-0.01091083511710167,
0.03578953817486763,
0.05211373418569565,
-0.03727710247039795,
0.004440201446413994,
-0.015149257145822048,
-0.10210749506950378,
0.009367816150188446,
0.014... |
7854671f-489d-4a80-9c3e-83f17b65670f | Syntax
sql
toBFloat16OrZero(x)
Arguments
x
β A String representation of a number.
String
.
Supported arguments:
String representations of numeric values.
Unsupported arguments (return
0
):
String representations of binary and hexadecimal values.
Numeric values.
Returned value
16-bit... | {"source_file": "type-conversion-functions.md"} | [
0.07794695347547531,
-0.003356197150424123,
-0.1409878432750702,
-0.027234183624386787,
-0.04152454063296318,
-0.01027920376509428,
0.07864070683717728,
0.03951304778456688,
-0.05822686851024628,
-0.011030995287001133,
-0.0609847754240036,
-0.09091495722532272,
-0.027652105316519737,
-0.01... |
0579750e-1bd5-4619-99a8-d478f1f13564 | response
βββββββββββxββ¬βtoTypeName(toDate('2022-12-30 01:02:03'))ββ
β 2022-12-30 β Date β
ββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββ
If the argument is a number and looks like a UNIX timestamp (is greater than 65535), it is interpreted as a
DateTime
, then truncat... | {"source_file": "type-conversion-functions.md"} | [
0.05514129623770714,
0.012570692226290703,
0.0015588946407660842,
0.022389007732272148,
-0.01103124674409628,
-0.07592325657606125,
-0.036015357822179794,
0.010896120220422745,
-0.01768370345234871,
0.05302363634109497,
-0.013934055343270302,
-0.11051897704601288,
-0.03985612839460373,
0.0... |
d7e1dd10-d6dd-4c51-b2d8-8b38e533797a | Example
Query:
sql
SELECT toDateOrNull('2022-12-30'), toDateOrNull('');
Result:
response
ββtoDateOrNull('2022-12-30')ββ¬βtoDateOrNull('')ββ
β 2022-12-30 β α΄Ία΅α΄Έα΄Έ β
ββββββββββββββββββββββββββββββ΄βββββββββββββββββββ
toDateOrDefault {#todateordefault}
Like
toDate
but if unsuccessful,... | {"source_file": "type-conversion-functions.md"} | [
0.012510137632489204,
-0.009687935002148151,
0.023110654205083847,
0.055267807096242905,
-0.019563432782888412,
-0.0196291022002697,
0.07495933026075363,
0.0688689798116684,
-0.01751934178173542,
0.031644050031900406,
-0.02044752798974514,
-0.10860752314329147,
-0.05231299623847008,
0.0276... |
b6759ff4-11c9-455b-894c-893a4b8bc3ea | toDateTimeOrDefault {#todatetimeordefault}
Like
toDateTime
but if unsuccessful, returns a default value which is either the third argument (if specified), or otherwise the lower boundary of
DateTime
.
Syntax
sql
toDateTimeOrDefault(expr [, time_zone [, default_value]])
Example
Query:
sql
SELECT toDateTim... | {"source_file": "type-conversion-functions.md"} | [
-0.0029042272362858057,
0.007528895512223244,
-0.011533990502357483,
0.02030596323311329,
0.04987327754497528,
-0.0270627923309803,
0.06918121129274368,
0.027369262650609016,
-0.03576740249991417,
0.012356352992355824,
-0.06557580828666687,
-0.13139976561069489,
-0.06012377515435219,
0.048... |
370547cf-e44f-4d14-8fa2-b887eac6fb08 | toDate32OrDefault {#todate32ordefault}
Converts the argument to the
Date32
data type. If the value is outside the range,
toDate32OrDefault
returns the lower border value supported by
Date32
. If the argument has
Date
type, it's borders are taken into account. Returns default value if an invalid argument is rec... | {"source_file": "type-conversion-functions.md"} | [
0.03355613350868225,
0.01953968219459057,
-0.016932407394051552,
0.06775535643100739,
-0.004583093803375959,
0.004798792768269777,
0.07333707809448242,
0.04103480651974678,
-0.06510695070028305,
0.015890808776021004,
-0.04113851860165596,
-0.12995676696300507,
-0.04822592809796333,
0.03445... |
f23d37c9-ebcd-43ed-acb8-384d6f5edc96 | toDateTime64OrZero {#todatetime64orzero}
Like
toDateTime64
, this function converts an input value to a value of type
DateTime64
but returns the min value of
DateTime64
if an invalid argument is received.
Syntax
sql
toDateTime64OrZero(expr, scale, [timezone])
Arguments
expr
β The value.
String
,
UIn... | {"source_file": "type-conversion-functions.md"} | [
0.034723762422800064,
0.03662559390068054,
-0.050628043711185455,
0.05912911891937256,
-0.046343762427568436,
-0.0010574812768027186,
0.0318564772605896,
0.05463868007063866,
-0.01715938188135624,
-0.021906962618231773,
-0.04983248561620712,
-0.15563105046749115,
-0.05557551234960556,
0.04... |
5c1f260b-c876-4574-8445-7f7de35ddd02 | Returned value
A calendar date and time of day, with sub-second precision, otherwise the minimum value of
DateTime64
or the
default
value if provided.
DateTime64
.
Example
Query:
sql
SELECT
toDateTime64OrDefault('1976-10-18 00:00:00 30', 3) AS invalid_arg,
toDateTime64OrDefault('1976-10-18 00:0... | {"source_file": "type-conversion-functions.md"} | [
0.002179368631914258,
0.035001277923583984,
-0.03758278489112854,
0.07356607913970947,
-0.06220002844929695,
-0.015678180381655693,
0.048335034400224686,
0.06187698245048523,
-0.020797137171030045,
0.006697625387459993,
-0.05035007745027542,
-0.15849831700325012,
-0.02249925583600998,
0.05... |
5133c540-4000-43bf-96d3-3a6480b2bc90 | Syntax
sql
toDecimal32OrZero(expr, S)
Arguments
expr
β A String representation of a number.
String
.
S
β Scale parameter between 0 and 9, specifying how many digits the fractional part of a number can have.
UInt8
.
Supported arguments:
- String representations of type (U)Int8/16/32/64/128/256.
- Strin... | {"source_file": "type-conversion-functions.md"} | [
-0.013803025707602501,
-0.031398314982652664,
-0.08520284295082092,
-0.0037279282696545124,
-0.019123433157801628,
-0.06870890408754349,
0.06689323484897614,
0.10762102901935577,
-0.0652480199933052,
-0.007324068807065487,
-0.045248620212078094,
-0.15000730752944946,
0.0010210460750386119,
... |
63104d0e-eedb-4133-bf72-8c278a819fa3 | See also
toDecimal32
.
toDecimal32OrZero
.
toDecimal32OrDefault
.
toDecimal32OrDefault {#todecimal32ordefault}
Like
toDecimal32
, this function converts an input value to a value of type
Decimal(9, S)
but returns the default value in case of an error.
Syntax
sql
toDecimal32OrDefault(expr, S[, defau... | {"source_file": "type-conversion-functions.md"} | [
0.02476394549012184,
-0.03502827137708664,
-0.08098627626895905,
0.0039625465869903564,
-0.05799735337495804,
-0.019582930952310562,
0.05668233335018158,
0.10467275232076645,
-0.0843280553817749,
-0.01668539084494114,
-0.05118987709283829,
-0.17043690383434296,
-0.041896361857652664,
0.049... |
d6f30c90-45c3-46a9-8672-375e813280a5 | :::note
An overflow can occur if the value of
expr
exceeds the bounds of
Decimal64
:
( -1 * 10^(18 - S), 1 * 10^(18 - S) )
.
Excessive digits in a fraction are discarded (not rounded).
Excessive digits in the integer part will lead to an exception.
:::
:::warning
Conversions drop extra digits and could operate in... | {"source_file": "type-conversion-functions.md"} | [
-0.011832981370389462,
0.046385057270526886,
0.005002192221581936,
-0.013407007791101933,
-0.039802614599466324,
-0.09061925113201141,
0.052298013120889664,
0.07005491107702255,
-0.0036231449339538813,
0.038911815732717514,
-0.03927842527627945,
-0.13504202663898468,
0.01593373343348503,
-... |
3178b206-fd99-414f-969f-58f352897c59 | Syntax
sql
toDecimal64OrNull(expr, S)
Arguments
expr
β A String representation of a number.
String
.
S
β Scale parameter between 0 and 18, specifying how many digits the fractional part of a number can have.
UInt8
.
Supported arguments:
- String representations of type (U)Int8/16/32/64/128/256.
- Stri... | {"source_file": "type-conversion-functions.md"} | [
0.023577233776450157,
0.003308602375909686,
-0.06023300066590309,
0.009637683629989624,
-0.026585282757878304,
-0.058984167873859406,
0.055643659085035324,
0.1038256362080574,
-0.07203496247529984,
0.006364861037582159,
-0.018292859196662903,
-0.11094004660844803,
0.014699515886604786,
0.0... |
a294bb41-2f15-47eb-b7ed-94dda570081d | :::
Returned value
Value of type
Decimal(18, S)
if successful, otherwise returns the default value if passed or
0
if not.
Decimal64(S)
.
Examples
Query:
sql
SELECT
toDecimal64OrDefault(toString(0.0001), 18) AS a,
toTypeName(a),
toDecimal64OrDefault('Inf', 0, CAST('-1', 'Decimal64(0)')) AS... | {"source_file": "type-conversion-functions.md"} | [
0.015500170178711414,
0.03528853505849838,
-0.04252122715115547,
0.03719687461853027,
-0.07699324935674667,
-0.007419817615300417,
0.09610533714294434,
0.08291751146316528,
-0.01897117868065834,
0.03508731722831726,
-0.01728084683418274,
-0.12867189943790436,
0.022568685933947563,
0.006688... |
693e321d-b49d-4fbd-819f-decb1dc527e0 | Arguments
expr
β A String representation of a number.
String
.
S
β Scale parameter between 0 and 38, specifying how many digits the fractional part of a number can have.
UInt8
.
Supported arguments:
- String representations of type (U)Int8/16/32/64/128/256.
- String representations of type Float32/64.
U... | {"source_file": "type-conversion-functions.md"} | [
-0.01142551377415657,
-0.0035623665899038315,
-0.07916844636201859,
-0.0067912740632891655,
-0.029219046235084534,
-0.046125512570142746,
0.07647740095853806,
0.1390107125043869,
-0.052430231124162674,
-0.010824967175722122,
-0.01606643944978714,
-0.10095693916082382,
0.01758357509970665,
... |
6afcd90c-5a92-449c-9c8d-57a22e13952f | See also
toDecimal128
.
toDecimal128OrZero
.
toDecimal128OrDefault
.
toDecimal128OrDefault {#todecimal128ordefault}
Like
toDecimal128
, this function converts an input value to a value of type
Decimal(38, S)
but returns the default value in case of an error.
Syntax
sql
toDecimal128OrDefault(expr, S... | {"source_file": "type-conversion-functions.md"} | [
0.015072811394929886,
-0.01605750434100628,
-0.06799406558275223,
0.005042990203946829,
-0.07160074263811111,
-0.017817538231611252,
0.05413225665688515,
0.10435035824775696,
-0.08315198123455048,
-0.012122317217290401,
-0.0316159650683403,
-0.1355942338705063,
-0.03708486258983612,
0.0466... |
24da146f-18fd-4463-9242-3aafb38d434b | Supported arguments:
- Values or string representations of type (U)Int8/16/32/64/128/256.
- Values or string representations of type Float32/64.
Unsupported arguments:
- Values or string representations of Float32/64 values
NaN
and
Inf
(case-insensitive).
- String representations of binary and hexadecimal values,... | {"source_file": "type-conversion-functions.md"} | [
-0.022131692618131638,
0.010747366584837437,
-0.02173086255788803,
-0.044755954295396805,
0.02644556201994419,
-0.1117502972483635,
0.03978348150849342,
0.09464320540428162,
-0.02826795168220997,
-0.011650606989860535,
-0.05662330612540245,
-0.13777099549770355,
-0.0003884673351421952,
0.0... |
a12e9047-b1be-4c63-a3a6-8665f22046b5 | Result:
response
Row 1:
ββββββ
a: 0.0001
toTypeName(a): Decimal(76, 76)
b: 0
toTypeName(b): Decimal(76, 76)
See also
toDecimal256
.
toDecimal256OrNull
.
toDecimal256OrDefault
.
toDecimal256OrNull {#todecimal256ornull}
Like
toDecimal256
, this function converts an input value t... | {"source_file": "type-conversion-functions.md"} | [
0.0032188796903938055,
-0.013267521746456623,
-0.10303046554327011,
0.02416958101093769,
-0.06714053452014923,
-0.04755478724837303,
0.07560674846172333,
0.06405184417963028,
-0.09904562681913376,
0.007027491927146912,
-0.0161973275244236,
-0.16673679649829865,
0.021284086629748344,
0.0142... |
6f5c0e05-b159-4fb0-8f8f-050b90ac314d | :::warning
Conversions drop extra digits and could operate in an unexpected way when working with Float32/Float64 inputs as the operations are performed using floating point instructions.
For example:
toDecimal256OrDefault(1.15, 2)
is equal to
1.14
because 1.15 * 100 in floating point is 114.99.
You can use a Strin... | {"source_file": "type-conversion-functions.md"} | [
0.000041086797864409164,
0.019301578402519226,
-0.05409223586320877,
0.011417653411626816,
-0.040221571922302246,
-0.06236810237169266,
0.10175979137420654,
0.06723444908857346,
0.010472084395587444,
0.02381419576704502,
-0.03193189948797226,
-0.15937501192092896,
0.02197316102683544,
-0.0... |
7fbe3a71-d094-4a03-b569-0e8dc44d9656 | Accepts a String or FixedString argument. Returns the String with the content truncated at the first zero byte found.
Syntax
sql
toStringCutToZero(s)
Example
Query:
sql
SELECT toFixedString('foo', 8) AS s, toStringCutToZero(s) AS s_cut;
Result:
response
ββsββββββββββββββ¬βs_cutββ
β foo\0\0\0\0\0 β foo β
... | {"source_file": "type-conversion-functions.md"} | [
0.039218418300151825,
-0.013510283082723618,
-0.023531846702098846,
0.025768402963876724,
-0.10734116286039352,
-0.013342256657779217,
0.10242113471031189,
0.11263056844472885,
-0.02804258093237877,
0.018374329432845116,
-0.025138752534985542,
-0.09028542041778564,
0.014059395529329777,
-0... |
fcaa3ad9-c090-43a6-9759-5a0566821264 | Returned value
Reinterpreted value
x
as UInt16.
UInt16
.
Example
Query:
sql
SELECT
toUInt8(257) AS x,
toTypeName(x),
reinterpretAsUInt16(x) AS res,
toTypeName(res);
Result:
response
ββxββ¬βtoTypeName(x)ββ¬βresββ¬βtoTypeName(res)ββ
β 1 β UInt8 β 1 β UInt16 β
βββββ΄ββββββ... | {"source_file": "type-conversion-functions.md"} | [
0.014149315655231476,
-0.04171786084771156,
-0.017465071752667427,
0.07699976116418839,
-0.10912284255027771,
0.0026584004517644644,
0.07220500707626343,
-0.010389099828898907,
-0.06468677520751953,
-0.0323343425989151,
-0.05296219140291214,
-0.05434127897024155,
0.00122460734564811,
-0.03... |
ac1a8c37-df4e-4cc9-9b38-e53680c30c1e | reinterpretAsUInt256 {#reinterpretasuint256}
Performs byte reinterpretation by treating the input value as a value of type UInt256. Unlike
CAST
, the function does not attempt to preserve the original value - if the target type is not able to represent the input type, the output is meaningless.
Syntax
sql
reinte... | {"source_file": "type-conversion-functions.md"} | [
-0.026833882555365562,
-0.06241140142083168,
0.016114821657538414,
0.06397085636854172,
-0.09774458408355713,
-0.017768586054444313,
0.0731610581278801,
-0.031495146453380585,
-0.04118453711271286,
-0.006959816440939903,
-0.05949191749095917,
-0.020877601578831673,
0.016475632786750793,
-0... |
4b35efaa-3e38-445a-bd30-41e3b922ed47 | Syntax
sql
reinterpretAsInt32(x)
Parameters
x
: value to byte reinterpret as Int32.
(U)Int*
,
Float
,
Date
,
DateTime
,
UUID
,
String
or
FixedString
.
Returned value
Reinterpreted value
x
as Int32.
Int32
.
Example
Query:
sql
SELECT
toInt16(257) AS x,
toTypeName(x),
reinter... | {"source_file": "type-conversion-functions.md"} | [
0.022818317636847496,
-0.03129595145583153,
-0.017477957531809807,
0.0813823714852333,
-0.07958605140447617,
-0.015288861468434334,
0.07195835560560226,
0.005958928260952234,
-0.07060866057872772,
-0.009305311366915703,
-0.04226304963231087,
-0.041530292481184006,
0.03383179381489754,
-0.0... |
ea10f623-fca3-405f-89ca-e03a25bb49a5 | Reinterpreted value
x
as Int256.
Int256
.
Example
Query:
sql
SELECT
toInt128(257) AS x,
toTypeName(x),
reinterpretAsInt256(x) AS res,
toTypeName(res);
Result:
response
ββββxββ¬βtoTypeName(x)ββ¬βresββ¬βtoTypeName(res)ββ
β 257 β Int128 β 257 β Int256 β
βββββββ΄ββββββββββββββββ΄ββ... | {"source_file": "type-conversion-functions.md"} | [
0.02424030750989914,
-0.05817970260977745,
-0.0044872090220451355,
0.08168764412403107,
-0.0817275270819664,
-0.0038357439916580915,
0.05790070444345474,
-0.02945239655673504,
-0.07139197736978531,
-0.016965065151453018,
-0.06288190186023712,
-0.052146755158901215,
0.005048542749136686,
-0... |
d2e96d41-f77e-4b47-ab03-7ea1d06564de | reinterpretAsDateTime {#reinterpretasdatetime}
These functions accept a string and interpret the bytes placed at the beginning of the string as a number in host order (little endian). Returns a date with time interpreted as the number of seconds since the beginning of the Unix Epoch.
Syntax
sql
reinterpretAsDateT... | {"source_file": "type-conversion-functions.md"} | [
-0.017633581534028053,
0.02441411279141903,
-0.03179705888032913,
0.07482802867889404,
-0.09428732097148895,
-0.017100123688578606,
0.004475320223718882,
0.024200493469834328,
0.005795554723590612,
0.031340911984443665,
0.01898820698261261,
-0.04612492769956589,
0.007300269789993763,
-0.05... |
ae2ae17d-4afe-4fab-8173-7b891df3ca90 | Example
Query:
sql
SELECT
reinterpretAsFixedString(toDateTime('1970-01-01 01:01:05')),
reinterpretAsFixedString(toDate('1970-03-07'));
Result:
response
ββreinterpretAsFixedString(toDateTime('1970-01-01 01:01:05'))ββ¬βreinterpretAsFixedString(toDate('1970-03-07'))ββ
β A ... | {"source_file": "type-conversion-functions.md"} | [
-0.029763931408524513,
0.0034277066588401794,
-0.0009495869744569063,
0.0337546207010746,
-0.059191636741161346,
-0.0216195248067379,
0.04455442726612091,
0.006097013130784035,
-0.05291491001844406,
-0.010160038247704506,
0.0015666944673284888,
-0.007192015182226896,
0.022914566099643707,
... |
a83e5a1f-76fa-462e-a7b9-bb77c3c288a9 | Result:
text
ββstring_to_array_of_Float32ββ
β [5.626,6.626,5.626,6.626] β
ββββββββββββββββββββββββββββββ
CAST {#cast}
Converts an input value to the specified data type. Unlike the
reinterpret
function,
CAST
tries to present the same value using the new data type. If the conversion can not be done then an ex... | {"source_file": "type-conversion-functions.md"} | [
0.03340044245123863,
-0.004589776508510113,
0.014328598976135254,
0.02721879817545414,
-0.1139410063624382,
-0.02820894680917263,
0.10135938972234726,
0.03007756546139717,
-0.0979093611240387,
0.00752769922837615,
-0.03751546889543533,
-0.043591711670160294,
0.0072594680823385715,
-0.07953... |
3ca85335-210b-454c-a0b4-c7dcd53313ea | Example
Query:
sql
SELECT cast(-1, 'UInt8') AS uint8;
Result:
response
ββuint8ββ
β 255 β
βββββββββ
Query:
sql
SELECT accurateCast(-1, 'UInt8') AS uint8;
Result:
response
Code: 70. DB::Exception: Received from localhost:9000. DB::Exception: Value in column Int8 cannot be safely converted into type UInt... | {"source_file": "type-conversion-functions.md"} | [
0.024343818426132202,
-0.022324368357658386,
-0.0029425753746181726,
0.04843160882592201,
-0.10950692743062973,
-0.029460124671459198,
0.10419458150863647,
0.039742786437273026,
-0.10306946933269501,
-0.026230977848172188,
-0.030050504952669144,
-0.08776932954788208,
0.075778067111969,
-0.... |
b632d70a-d42b-4c52-922b-a0bf7c8f8f9c | toInterval {#toInterval}
Creates an
Interval
data type value from a numeric value and interval unit (eg. 'second' or 'day').
Syntax
sql
toInterval(value, unit)
Arguments
value
β Length of the interval. Integer numbers or string representations thereof, and float numbers.
(U)Int*
/
Float*
/
String
.
... | {"source_file": "type-conversion-functions.md"} | [
-0.0024783380795270205,
-0.0007937957998365164,
0.019928492605686188,
0.05506415292620659,
-0.0932973176240921,
0.013034488074481487,
0.028365546837449074,
0.034328561276197433,
-0.06528332829475403,
-0.03041110374033451,
0.017163332551717758,
-0.11373177915811539,
0.0481591522693634,
0.03... |
d8a04602-06c0-4739-9615-6855610231b2 | Returned values
Interval of
n
weeks.
IntervalWeek
.
Example
Query:
sql
WITH
toDate('2024-06-15') AS date,
toIntervalWeek(1) AS interval_to_week
SELECT date + interval_to_week AS result
Result:
response
ββββββresultββ
β 2024-06-22 β
ββββββββββββββ
toIntervalDay {#tointervalday}
Returns an ... | {"source_file": "type-conversion-functions.md"} | [
-0.03394698351621628,
0.034002043306827545,
0.012607582844793797,
0.0873304232954979,
-0.0926942452788353,
-0.009148865938186646,
0.03193758800625801,
0.029444711282849312,
-0.08040904998779297,
-0.039724692702293396,
-0.032051168382167816,
-0.09302514046430588,
0.024671101942658424,
-0.01... |
edc005f6-250e-4ab5-8824-9cf058f72ff8 | Returned values
Interval of
n
milliseconds.
IntervalMilliseconds
.
Example
Query:
sql
WITH
toDateTime('2024-06-15') AS date,
toIntervalMillisecond(30) AS interval_to_milliseconds
SELECT date + interval_to_milliseconds AS result
Result:
response
βββββββββββββββββββresultββ
β 2024-06-15 00:00:0... | {"source_file": "type-conversion-functions.md"} | [
-0.0010594716295599937,
-0.018524490296840668,
-0.013645215891301632,
0.07734409719705582,
-0.06760863959789276,
-0.006709540728479624,
0.019044335931539536,
0.08023834973573685,
-0.00783463940024376,
-0.013097461313009262,
0.022506700828671455,
-0.11419934034347534,
0.003919141832739115,
... |
9d148350-60a1-49a8-8f39-51b22ad9a3a4 | parseDateTimeOrNull {#parsedatetimeornull}
Same as for
parseDateTime
except that it returns
NULL
when it encounters a date format that cannot be processed.
Alias:
str_to_date
.
parseDateTimeInJodaSyntax {#parsedatetimeinjodasyntax}
Similar to
parseDateTime
, except that the format string is in
Joda
inst... | {"source_file": "type-conversion-functions.md"} | [
0.02579142153263092,
0.03173336759209633,
-0.015484398230910301,
0.01186096016317606,
-0.04444039240479469,
-0.019233785569667816,
0.0067499722354114056,
0.08310338854789734,
-0.01585335284471512,
-0.028532514348626137,
-0.04142550006508827,
-0.09269468486309052,
-0.003236363874748349,
0.0... |
c40ae578-3901-4117-ac70-724492e65033 | Arguments
str
β The String to be parsed.
format
β The format string. Optional.
yyyy-MM-dd HH:mm:ss
if not specified.
timezone
β
Timezone
. Optional.
Returned value(s)
Return a
DateTime64
value parsed from the input string according to a Joda-style format string.
The precision of the returned value... | {"source_file": "type-conversion-functions.md"} | [
0.031845442950725555,
0.057568661868572235,
-0.06796922534704208,
0.008054319769144058,
-0.04562355950474739,
0.01838342472910881,
-0.0871090218424797,
0.03158963844180107,
0.004112016875296831,
-0.04993756115436554,
-0.032568395137786865,
-0.04731111228466034,
-0.05388675257563591,
-0.015... |
eda20d8e-6617-4a5e-bc4f-1afeff98c22e | Query:
sql
SELECT parseDateTimeBestEffort('Sat, 18 Aug 2018 07:22:16 GMT', 'Asia/Istanbul')
AS parseDateTimeBestEffort;
Result:
response
ββparseDateTimeBestEffortββ
β 2018-08-18 10:22:16 β
βββββββββββββββββββββββββββ
Query:
sql
SELECT parseDateTimeBestEffort('1284101485')
AS parseDateTimeBestEffort;
Res... | {"source_file": "type-conversion-functions.md"} | [
0.0036844632122665644,
-0.012726180255413055,
0.026528602465987206,
0.03776298090815544,
-0.03884339705109596,
-0.0047369408421218395,
0.05710950493812561,
0.03386537358164787,
0.01654442958533764,
0.020428454503417015,
0.010867144912481308,
-0.05494222790002823,
-0.05878453329205513,
0.01... |
43377779-6299-4ef7-a2ce-e1808aa9e266 | parseDateTimeBestEffortUSOrNull {#parsedatetimebesteffortusornull}
Same as
parseDateTimeBestEffortUS
function except that it returns
NULL
when it encounters a date format that cannot be processed.
parseDateTimeBestEffortUSOrZero {#parsedatetimebesteffortusorzero}
Same as
parseDateTimeBestEffortUS
function e... | {"source_file": "type-conversion-functions.md"} | [
0.032715845853090286,
-0.018602823838591576,
-0.032961808145046234,
0.030333612114191055,
-0.015289605595171452,
-0.013753007166087627,
-0.009535592049360275,
0.09619304537773132,
-0.021036481484770775,
0.008841972798109055,
-0.02645930089056492,
-0.0808434933423996,
-0.034140583127737045,
... |
db140826-aeba-465e-a953-50ace604dc2a | parseDateTime64BestEffortUSOrZero {#parsedatetime64besteffortusorzero}
Same as for
parseDateTime64BestEffort
, except that this function prefers US date format (
MM/DD/YYYY
etc.) in case of ambiguity and returns zero date or zero date time when it encounters a date format that cannot be processed.
toLowCardinalit... | {"source_file": "type-conversion-functions.md"} | [
0.08436721563339233,
0.03807196393609047,
-0.0581737756729126,
0.06033778190612793,
-0.05010513961315155,
-0.002231323393061757,
0.014604007825255394,
0.11619054526090622,
-0.05368323624134064,
-0.03173069283366203,
-0.02125607430934906,
-0.09215262532234192,
0.004310670308768749,
-0.00339... |
34ab9533-f786-457e-a26f-50c2f7e225c4 | Converts a
DateTime64
to a
Int64
value with fixed millisecond precision. The input value is scaled up or down appropriately depending on its precision.
:::note
The output value is a timestamp in UTC, not in the timezone of
DateTime64
.
:::
Syntax
sql
toUnixTimestamp64Milli(value)
Arguments
value
β Dat... | {"source_file": "type-conversion-functions.md"} | [
0.04051205888390541,
0.013627302832901478,
-0.06235962733626366,
0.043452873826026917,
-0.041481874883174896,
0.0008344129892066121,
-0.028318168595433235,
0.05337349697947502,
-0.000298288679914549,
-0.0059294318780303,
-0.0024005863815546036,
-0.08901512622833252,
0.016067195683717728,
-... |
d6baccd6-7d25-41e5-80ec-c35145c78902 | Example
Query:
sql
WITH CAST(1733935988, 'Int64') AS i64
SELECT
fromUnixTimestamp64Second(i64, 'UTC') AS x,
toTypeName(x);
Result:
response
ββββββββββββββββββββxββ¬βtoTypeName(x)βββββββββ
β 2024-12-11 16:53:08 β DateTime64(0, 'UTC') β
βββββββββββββββββββββββ΄βββββββββββββββββββββββ
fromUnixTimestamp64Mi... | {"source_file": "type-conversion-functions.md"} | [
0.06250934302806854,
0.02244637906551361,
-0.0734245628118515,
0.03941669315099716,
-0.07979699224233627,
-0.017113300040364265,
0.01270473375916481,
0.06706070154905319,
-0.03295502811670303,
-0.008907608687877655,
-0.041612859815359116,
-0.09886442124843597,
0.030778352171182632,
-0.0079... |
798ed8df-b98e-43b6-ba57-a65a9e9d71b4 | Example
Query:
sql
WITH CAST(1733935988123456789, 'Int64') AS i64
SELECT
fromUnixTimestamp64Nano(i64, 'UTC') AS x,
toTypeName(x);
Result:
response
ββββββββββββββββββββββββββββββxββ¬βtoTypeName(x)βββββββββ
β 2024-12-11 16:53:08.123456789 β DateTime64(9, 'UTC') β
βββββββββββββββββββββββββββββββββ΄ββββββββββ... | {"source_file": "type-conversion-functions.md"} | [
0.04039397090673447,
0.013193387538194656,
-0.024688705801963806,
0.034246575087308884,
-0.09996821731328964,
0.03708863630890846,
0.030440255999565125,
0.05652867257595062,
-0.022178510203957558,
0.008019095286726952,
-0.038001470267772675,
-0.050843462347984314,
0.05384242162108421,
-0.0... |
16cd4485-a21f-4903-bdbd-40f1dc1ae17e | description: 'Overview of external dictionaries functionality in ClickHouse'
sidebar_label: 'Defining Dictionaries'
sidebar_position: 35
slug: /sql-reference/dictionaries
title: 'Dictionaries'
doc_type: 'reference'
import SelfManaged from '@site/docs/_snippets/_self_managed_only_no_roadmap.md';
import CloudDetails ... | {"source_file": "index.md"} | [
-0.0236422810703516,
0.005949774291366339,
-0.04412141442298889,
0.015228133648633957,
0.0044370549730956554,
-0.036927491426467896,
0.06681393086910248,
-0.013787813484668732,
-0.0518445186316967,
-0.0035851402208209038,
0.02994612790644169,
-0.011634941212832928,
0.09764227271080017,
-0.... |
55a71ab1-2b1c-4fbc-9159-8f35976575b6 | Creating a dictionary with a configuration file {#creating-a-dictionary-with-a-configuration-file}
:::note
Creating a dictionary with a configuration file is not applicable to ClickHouse Cloud. Please use DDL (see above), and create your dictionary as user
default
.
:::
The dictionary configuration file has the ... | {"source_file": "index.md"} | [
-0.005412044934928417,
-0.0001373391569359228,
-0.10606800019741058,
-0.02587452530860901,
-0.06767042726278305,
-0.04960706830024719,
0.05306056886911392,
-0.056977782398462296,
-0.03796433284878731,
0.0302643571048975,
0.0896766185760498,
-0.016563013195991516,
0.09803151339292526,
-0.04... |
52f4fe89-47f3-47df-a370-40ad54e00ce3 | Corresponding
DDL-query
:
sql
CREATE DICTIONARY (...)
...
LAYOUT(LAYOUT_TYPE(param value)) -- layout settings
...
Dictionaries without word
complex-key*
in a layout have a key with
UInt64
type,
complex-key*
dictionaries have a composite key (complex, with arbitrary types).
UInt64
keys in XML dictionaries ... | {"source_file": "index.md"} | [
0.04122330993413925,
0.012002531439065933,
-0.1323430836200714,
-0.008467612788081169,
-0.07279901951551437,
-0.07962287962436676,
0.005752094089984894,
0.005594287533313036,
-0.03061530366539955,
-0.008868547156453133,
0.06673260033130646,
-0.00963978748768568,
0.10992669314146042,
-0.076... |
759821cc-2f3f-475a-a399-cfb1b1bd9e00 | Configuration example:
xml
<layout>
<hashed />
</layout>
or
sql
LAYOUT(HASHED())
Configuration example:
``xml
<layout>
<hashed>
<!-- If shards greater then 1 (default is
1`) the dictionary will load
data in parallel, useful if you have huge amount of elements in one
dictionary. -->
... | {"source_file": "index.md"} | [
0.023916326463222504,
-0.00717865489423275,
-0.07089827954769135,
-0.0017090080073103309,
-0.08678660541772842,
-0.08969133347272873,
-0.04100592061877251,
-0.017724312841892242,
-0.006017068866640329,
0.004245813004672527,
0.018931306898593903,
0.07898776978254318,
0.05873897299170494,
-0... |
81a1c21f-8960-4f3f-a71b-90c071f37136 | or
sql
LAYOUT(COMPLEX_KEY_SPARSE_HASHED([SHARDS 1] [SHARD_LOAD_QUEUE_BACKLOG 10000] [MAX_LOAD_FACTOR 0.5]))
hashed_array {#hashed_array}
The dictionary is completely stored in memory. Each attribute is stored in an array. The key attribute is stored in the form of a hashed table where value is an index in the att... | {"source_file": "index.md"} | [
0.03156168758869171,
0.019099125638604164,
-0.13622352480888367,
-0.0011836346238851547,
-0.04192589223384857,
-0.09455612301826477,
-0.010631267912685871,
-0.019601283594965935,
0.03734074532985687,
0.031108753755688667,
0.04488806799054146,
0.1353950798511505,
0.09749333560466766,
-0.100... |
23b7edf1-8d07-4ed0-8bbb-7f454c9dd482 | or
sql
CREATE DICTIONARY discounts_dict (
advertiser_id UInt64,
discount_start_date Date,
discount_end_date Date,
amount Float64
)
PRIMARY KEY id
SOURCE(CLICKHOUSE(TABLE 'discounts'))
LIFETIME(MIN 1 MAX 1000)
LAYOUT(RANGE_HASHED(range_lookup_strategy 'max'))
RANGE(MIN discount_start_date MAX discount_... | {"source_file": "index.md"} | [
-0.06939832121133804,
0.06772131472826004,
-0.07160618156194687,
0.004356703720986843,
-0.06566064059734344,
0.00022442788758780807,
0.021351400762796402,
0.03515661507844925,
-0.020824575796723366,
-0.0034042007755488157,
0.04949897527694702,
-0.015723345801234245,
0.04576614499092102,
-0... |
04eac73b-f42a-4c04-a2d1-3f8b55dfbafa | ```sql
CREATE TABLE discounts
(
advertiser_id UInt64,
discount_start_date Date,
discount_end_date Nullable(Date),
amount Float64
)
ENGINE = Memory;
INSERT INTO discounts VALUES (1, '2015-01-01', Null, 0.1);
INSERT INTO discounts VALUES (1, '2015-01-15', Null, 0.2);
INSERT INTO discounts VALUES (2, '20... | {"source_file": "index.md"} | [
-0.01906849443912506,
0.025167765095829964,
0.010849381797015667,
0.029316283762454987,
-0.034383080899715424,
0.024115756154060364,
0.019399238750338554,
0.0033583950717002153,
0.004155536647886038,
0.02955496497452259,
0.14570720493793488,
-0.05552535876631737,
0.03070242330431938,
-0.04... |
59657fbf-7594-4184-80f3-a6cc2b54e0ec | select dictGet('discounts_dict', 'amount', 1, toDate('2015-01-14')) res;
ββresββ
β 0.1 β -- the only one range is matching: 2015-01-01 - Null
βββββββ
select dictGet('discounts_dict', 'amount', 1, toDate('2015-01-16')) res;
ββresββ
β 0.1 β -- two ranges are matching, range_min 2015-01-01 (0.1) is less than 2015-01-15 ... | {"source_file": "index.md"} | [
-0.030067194253206253,
0.09094681590795517,
0.07028286904096603,
-0.012379692867398262,
-0.02698657661676407,
0.0020486973226070404,
-0.010286049917340279,
0.006625431589782238,
0.025209689512848854,
0.028782008215785027,
0.049149129539728165,
-0.12963367998600006,
0.02568153105676174,
-0.... |
79c67f37-348a-4ab0-8b43-e6f22f8ba6d0 | If setting
allow_read_expired_keys
is set to 1, by default 0. Then dictionary can support asynchronous updates. If a client requests keys and all of them are in cache, but some of them are expired, then dictionary will return expired keys for a client and request them asynchronously from the source.
To improve cach... | {"source_file": "index.md"} | [
-0.04422958940267563,
0.02015259489417076,
-0.14345845580101013,
0.01731235347688198,
-0.1073991060256958,
-0.10151591151952744,
-0.016492020338773727,
-0.04087035730481148,
0.03332999348640442,
0.038023024797439575,
0.07847750186920166,
0.08281262964010239,
0.05277207866311073,
-0.1223413... |
a94b1e5a-26b0-4e74-8983-c1584ea08bba | or
sql
LAYOUT(SSD_CACHE(BLOCK_SIZE 4096 FILE_SIZE 16777216 READ_BUFFER_SIZE 1048576
PATH '/var/lib/clickhouse/user_files/test_dict'))
complex_key_ssd_cache {#complex_key_ssd_cache}
This type of storage is for use with composite
keys
. Similar to
ssd_cache
.
direct {#direct}
The dictionary is not stored ... | {"source_file": "index.md"} | [
-0.038946621119976044,
-0.0009172364370897412,
-0.12137093394994736,
-0.023419752717018127,
-0.03589196503162384,
-0.07412049174308777,
0.005785264074802399,
-0.000511123042088002,
0.003851634915918112,
-0.01460959855467081,
0.06394926458597183,
0.1408034861087799,
0.0508243665099144,
-0.0... |
6fc4a47c-c4d6-4007-bb61-b6cb2c8412ad | ββresultββ
β NP β
ββββββββββ
SELECT dictGet('my_ip_trie_dictionary', 'asn', IPv6StringToNum('2001:db8::1')) AS result;
ββresultββ
β 65536 β
ββββββββββ
SELECT dictGet('my_ip_trie_dictionary', ('asn', 'cca2'), IPv6StringToNum('2001:db8::1')) AS result;
ββresultββββββββ
β (65536,'ZZ') β
ββββββββββββββββ
```
... | {"source_file": "index.md"} | [
-0.07576807588338852,
-0.038195837289094925,
-0.035753604024648666,
0.0026592242065817118,
-0.014467147178947926,
-0.10251973569393158,
0.0020900091622024775,
-0.09657368063926697,
0.012286249548196793,
-0.014271644875407219,
0.0775287076830864,
0.06293175369501114,
-0.01802884228527546,
-... |
ad99df71-0f4f-4bba-957d-081bfbdb5b9f | The dictionary table must have a field that always changes when the source data is updated.
The settings of the source must specify a query that retrieves the changing field. The ClickHouse server interprets the query result as a row, and if this row has changed relative to its previous state, the dictionary is updat... | {"source_file": "index.md"} | [
-0.04280061647295952,
-0.017680490389466286,
-0.08592287451028824,
0.03670554608106613,
-0.04086592420935631,
-0.11783924698829651,
0.03486933559179306,
-0.07229070365428925,
0.05973084270954132,
0.023709464818239212,
0.03370916098356247,
0.025573454797267914,
0.06649040430784225,
-0.12649... |
579d9827-fda7-4015-b5a4-d80e2c2d420c | sql
...
SOURCE(CLICKHOUSE(... update_field 'added_time' update_lag 15))
...
Dictionary Sources {#dictionary-sources}
A dictionary can be connected to ClickHouse from many different sources.
If the dictionary is configured using an xml-file, the configuration looks like this:
xml
<clickhouse>
<dictionary>
... | {"source_file": "index.md"} | [
-0.049965400248765945,
-0.06517372280359268,
-0.0841400995850563,
0.007003472652286291,
-0.06965802609920502,
-0.09860612452030182,
0.08629375696182251,
-0.023306846618652344,
-0.020886708050966263,
0.004292523954063654,
0.05291800945997238,
-0.03799218311905861,
0.07807440310716629,
-0.13... |
73bb549c-a3ca-497f-b5ca-894d73bc94eb | format
β The file format. All the formats described in
Formats
are supported.
command_termination_timeout
β The executable script should contain a main read-write loop. After the dictionary is destroyed, the pipe is closed, and the executable file will have
command_termination_timeout
seconds to shutdown before... | {"source_file": "index.md"} | [
0.032278332859277725,
0.03386807069182396,
-0.1235131099820137,
0.018001314252614975,
-0.05426691472530365,
-0.02546129934489727,
-0.027327420189976692,
0.09913813322782516,
-0.03182487562298775,
0.014508342370390892,
0.01825992949306965,
0.013049651868641376,
-0.029524490237236023,
-0.074... |
2d75745f-6039-45fe-b90d-3a14216678d4 | Setting fields:
command
β The absolute path to the executable file, or the file name (if the program directory is written to
PATH
).
format
β The file format. All the formats described in "
Formats
" are supported.
pool_size
β Size of pool. If 0 is specified as
pool_size
then there is no pool size restric... | {"source_file": "index.md"} | [
0.03760147839784622,
-0.006688512396067381,
-0.13161662220954895,
0.016388999298214912,
-0.05878030136227608,
-0.02966129593551159,
-0.02505909651517868,
0.13434869050979614,
-0.040730465203523636,
-0.010120001621544361,
0.01183377020061016,
-0.03369007259607315,
-0.0391337089240551,
-0.05... |
33956762-3b56-49d3-afd8-8659a34cb42c | or
sql
SOURCE(HTTP(
url 'http://[::1]/os.tsv'
format 'TabSeparated'
credentials(user 'user' password 'password')
headers(header(name 'API-KEY' value 'key'))
))
In order for ClickHouse to access an HTTPS resource, you must
configure openSSL
in the server configuration.
Setting fields:
url
β ... | {"source_file": "index.md"} | [
-0.023101806640625,
-0.017725756391882896,
-0.1615510880947113,
-0.018047505989670753,
-0.0459180623292923,
-0.07122743874788284,
-0.026152849197387695,
-0.015347521752119064,
-0.01629105769097805,
0.017051229253411293,
-0.022661689668893814,
-0.012826953083276749,
0.060959164053201675,
0.... |
9f6d3eff-1800-4c82-bfea-6f422d5cf46d | Known Vulnerability of the ODBC Dictionary Functionality {#known-vulnerability-of-the-odbc-dictionary-functionality}
:::note
When connecting to the database through the ODBC driver connection parameter
Servername
can be substituted. In this case values of
USERNAME
and
PASSWORD
from
odbc.ini
are sent to the re... | {"source_file": "index.md"} | [
-0.029909584671258926,
-0.025368137285113335,
-0.1989040970802307,
0.05526422709226608,
-0.1215960830450058,
-0.052578698843717575,
0.060887474566698074,
0.04638080671429634,
-0.006891857832670212,
-0.0470576286315918,
-0.04863622412085533,
0.0404762402176857,
0.04067471995949745,
-0.07526... |
b20588b0-fafa-40fd-8036-b40d3fc6383f | Example of Connecting MS SQL Server {#example-of-connecting-ms-sql-server}
Ubuntu OS.
Installing the ODBC driver for connecting to MS SQL:
bash
$ sudo apt-get install tdsodbc freetds-bin sqsh
Configuring the driver:
```bash
$ cat /etc/freetds/freetds.conf
...
[MSSQL]
host = 192.168.56.101
port = 143... | {"source_file": "index.md"} | [
-0.027198318392038345,
-0.09541037678718567,
-0.07857351750135422,
0.01493033766746521,
-0.0016580134397372603,
-0.04611361026763916,
0.05184221640229225,
0.07532963901758194,
0.046428415924310684,
0.06975236535072327,
0.0008874718332663178,
0.033737439662218094,
0.02636948600411415,
-0.01... |
41f56679-3204-4412-a085-149bbcc7f6a4 | Setting fields:
port
β The port on the MySQL server. You can specify it for all replicas, or for each one individually (inside
<replica>
).
user
β Name of the MySQL user. You can specify it for all replicas, or for each one individually (inside
<replica>
).
password
β Password of the MySQL user. ... | {"source_file": "index.md"} | [
0.0118901077657938,
-0.05463385954499245,
-0.07245843857526779,
-0.013195252045989037,
-0.08715797960758209,
-0.06961021572351456,
-0.005168613512068987,
-0.0027995400596410036,
-0.02789589948952198,
0.047616615891456604,
-0.023158662021160126,
-0.0008945990703068674,
0.1693652719259262,
0... |
21332986-e50c-4566-ac52-d24680e16235 | ClickHouse {#clickhouse}
Example of settings:
xml
<source>
<clickhouse>
<host>example01-01-1</host>
<port>9000</port>
<user>default</user>
<password></password>
<db>default</db>
<table>ids</table>
<where>id=10</where>
<secure>1</secure>
<qu... | {"source_file": "index.md"} | [
0.05228814482688904,
-0.043776609003543854,
-0.1045856699347496,
0.014501909725368023,
-0.08669465035200119,
-0.05319890007376671,
0.0592644028365612,
-0.010921796783804893,
-0.05852678790688515,
-0.008313334546983242,
0.04838303104043007,
-0.048242151737213135,
0.13966786861419678,
-0.064... |
8352e8a2-1d89-44b2-b717-1e74a645ab0f | xml
<source>
<redis>
<host>localhost</host>
<port>6379</port>
<storage_type>simple</storage_type>
<db_index>0</db_index>
</redis>
</source>
or
sql
SOURCE(REDIS(
host 'localhost'
port 6379
storage_type 'simple'
db_index 0
))
Setting fields:
host
β The Re... | {"source_file": "index.md"} | [
0.0393720418214798,
0.01247902400791645,
-0.12808683514595032,
-0.015895601361989975,
-0.05534416437149048,
-0.07015660405158997,
-0.008652236312627792,
0.04867812991142273,
-0.04309694096446037,
-0.00983826257288456,
0.04360462725162506,
-0.005551333539187908,
0.12098341435194016,
-0.1371... |
779b0ca9-9319-468d-a4df-3dfb782b0d97 | PostgreSQL {#postgresql}
Example of settings:
xml
<source>
<postgresql>
<host>postgresql-hostname</hoat>
<port>5432</port>
<user>clickhouse</user>
<password>qwerty</password>
<db>db_name</db>
<table>table_name</table>
<where>id=10</where>
<invalidate_query>SQL_QUERY... | {"source_file": "index.md"} | [
0.01762116141617298,
0.01375051774084568,
-0.07640761882066727,
0.00009902249439619482,
-0.06999856978654861,
-0.009609888307750225,
-0.011496004648506641,
-0.017158370465040207,
-0.03867024928331375,
0.045642152428627014,
0.0616007000207901,
-0.05610428377985954,
0.03705734387040138,
-0.0... |
a0eb798e-d17c-4599-b6bf-998532dc3c08 | Dictionary Key and Fields {#dictionary-key-and-fields}
The
structure
clause describes the dictionary key and fields available for queries.
XML description:
```xml
Id
<attribute>
<!-- Attribute parameters -->
</attribute>
...
</structure>
```
Attributes are described in t... | {"source_file": "index.md"} | [
-0.02382577583193779,
-0.007621205877512693,
-0.08127571642398834,
0.0008080267580226064,
-0.041629042476415634,
-0.058721404522657394,
0.08259841799736023,
-0.04806797578930855,
-0.020330538973212242,
-0.03957020863890648,
0.06732537597417831,
-0.00283147394657135,
0.12907454371452332,
-0... |
6eb05c99-0cb3-4556-8097-ab0a34525b6e | | Tag | Description ... | {"source_file": "index.md"} | [
-0.0034570067655295134,
0.07680454850196838,
-0.008665449917316437,
-0.013504531234502792,
0.11089115589857101,
-0.007485589943826199,
0.0341411791741848,
0.020732751116156578,
-0.0027893672231584787,
-0.032130319625139236,
-0.020735464990139008,
-0.1017616018652916,
0.08019524067640305,
0... |
a9a0e20e-6e84-4e04-b54f-35bc2c11867d | |------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------... | {"source_file": "index.md"} | [
-0.04348547011613846,
0.0023216381669044495,
-0.04704635590314865,
-0.03225376456975937,
-0.09775859862565994,
0.013375223614275455,
-0.001099019660614431,
0.04466715082526207,
-0.002515157451853156,
-0.06045687943696976,
0.06121503561735153,
-0.02469663694500923,
-0.03292921930551529,
-0.... |
d99c3f13-4443-4ace-8e60-24cbf06f171c | |
name
| Column name. ... | {"source_file": "index.md"} | [
0.011370042338967323,
0.011405706405639648,
-0.12058524042367935,
0.005970833357423544,
-0.08200963586568832,
-0.040373750030994415,
0.05928139388561249,
0.010807713493704796,
-0.05974431708455086,
0.004268669057637453,
0.04306759685277939,
-0.03411256894469261,
0.08217048645019531,
-0.023... |
18b0267c-a05b-4656-8e84-ff11cf73ad80 | |
null_value
| Default value for a non-existing element.
In the example, it is an empty string.
NULL
value can be used only for the
Nullable
types (see the previous line with types description). ... | {"source_file": "index.md"} | [
0.021859748288989067,
-0.0060205599293112755,
-0.09110474586486816,
0.03225427493453026,
-0.06533898413181305,
0.017397642135620117,
0.027228035032749176,
0.054254017770290375,
-0.014074069447815418,
0.038373593240976334,
0.054288554936647415,
-0.08396988362073898,
0.05690900236368179,
-0.... |
cde9d302-b351-4b1b-ba14-0cb618daae89 | Expression
that ClickHouse executes on the value.
The expression can be a column name in the remote SQL database. Thus, you can use it to create an alias for the remote column.
Default value: no expression. ... | {"source_file": "index.md"} | [
0.02710483781993389,
-0.019171563908457756,
-0.06481708586215973,
0.02845904603600502,
-0.04878120496869087,
0.0007815329590812325,
0.026970233768224716,
-0.01983133889734745,
0.017298337072134018,
0.04733995720744133,
0.053114600479602814,
-0.07319503277540207,
0.0690433457493782,
0.00810... |
e650dddf-fb8d-4892-bfe4-0340a6de5aff | |
hierarchical
| If
true
, the attribute contains the value of a parent key for the current key. See
Hierarchical Dictionaries
.
Default value:
false
. ... | {"source_file": "index.md"} | [
-0.007895104587078094,
0.029440466314554214,
-0.045691173523664474,
0.03589138388633728,
0.04922634735703468,
-0.06683517247438431,
0.005251809023320675,
-0.09065534174442291,
-0.004336732905358076,
-0.02332267537713051,
0.11326959729194641,
0.0025475830771028996,
0.05558183416724205,
-0.0... |
b83dba24-bf44-4e3b-9d9b-7c2415d90cdd | true
, ClickHouse can automatically place after the
GROUP BY
clause the requests to dictionaries with injection. Usually it significantly reduces the amount of such requests.
Default value:
false
. ... | {"source_file": "index.md"} | [
0.02077512815594673,
0.018347594887018204,
-0.0650540292263031,
0.1012209802865982,
-0.012614654377102852,
-0.06623444706201553,
-0.004415392410010099,
-0.1272175908088684,
0.006882460322231054,
-0.04329478368163109,
0.03221270069479942,
0.021502166986465454,
-0.022347966209053993,
-0.0388... |
0e2a0aff-277a-4073-8432-0a22d73991c8 | Hierarchical Dictionaries {#hierarchical-dictionaries}
ClickHouse supports hierarchical dictionaries with a
numeric key
.
Look at the following hierarchical structure:
text
0 (Common parent)
β
βββ 1 (Russia)
β β
β βββ 2 (Moscow)
β β
β βββ 3 (Center)
β
βββ 4 (Great Britain)
β
βββ 5 (London... | {"source_file": "index.md"} | [
0.06601455062627792,
-0.031319525092840195,
-0.0076703475788235664,
-0.06783508509397507,
0.00040440057637169957,
-0.07036255300045013,
-0.016562987118959427,
-0.05291973799467087,
-0.0277871023863554,
0.004583367612212896,
0.027484608814120293,
-0.046048153191804886,
0.014809366315603256,
... |
d4702916-1504-4e73-b1f2-c222e55c8e09 | Points can be specified as an array or a tuple of their coordinates. In the current implementation, only two-dimensional points are supported.
The user can upload their own data in all formats supported by ClickHouse.
There are 3 types of
in-memory storage
available:
POLYGON_SIMPLE
. This is a naive impleme... | {"source_file": "index.md"} | [
0.05781754106283188,
0.00230203615501523,
-0.11869083344936371,
0.04558980464935303,
0.007241375278681517,
-0.045778561383485794,
0.03251096233725548,
-0.0023838107008486986,
0.04957634583115578,
0.020630117505788803,
-0.05367857217788696,
0.021192533895373344,
0.057642288506031036,
-0.016... |
2119b33e-81c8-458d-b3fe-2d851fc451e0 | SELECT * FROM polygons_test_dictionary;
```
Result:
text
ββkeyββββββββββββββββββββββββββββββ¬βnameβββ
β [[[(3,1),(0,1),(0,-1),(3,-1)]]] β Value β
βββββββββββββββββββββββββββββββββββ΄ββββββββ
Regular Expression Tree Dictionary {#regexp-tree-dictionary}
This dictionary lets you map keys to values based on hierarchi... | {"source_file": "index.md"} | [
0.05614542216062546,
0.009667536243796349,
0.0352160781621933,
-0.023827770724892616,
-0.019658079370856285,
-0.062017809599637985,
0.11345691978931427,
-0.06037617102265358,
-0.04328029230237007,
0.027126511558890343,
0.037106215953826904,
-0.03196652606129646,
0.05174366012215614,
-0.051... |
7b73f6ed-b2e3-4d6a-a947-35a087a3dd8a | Regexp tree dictionaries only allow access using the functions
dictGet
,
dictGetOrDefault
, and
dictGetAll
.
Example:
sql
SELECT dictGet('regexp_dict', ('name', 'version'), '31/tclwebkit1024');
Result:
text
ββdictGet('regexp_dict', ('name', 'version'), '31/tclwebkit1024')ββ
β ('Android','12') ... | {"source_file": "index.md"} | [
-0.06845540553331375,
0.07573086768388748,
0.07429252564907074,
-0.0664229467511177,
-0.0010514773894101381,
-0.06884509325027466,
0.06965900212526321,
-0.07464777678251266,
0.029951734468340874,
0.020884983241558075,
0.0422607846558094,
-0.0710986852645874,
0.062177594751119614,
-0.021755... |
619f7580-3cd4-48fd-a574-9031e8ac2bfd | Result:
text
ββurlβββββββββββββββββββββββββββββββββββββ¬βdictGetAll('regexp_dict', ('tag', 'topological_index', 'captured', 'parent'), url, 2)ββ
β clickhouse.com β (['ClickHouse'],[1],[],[]) β
β clickhouse.com/docs/en β ... | {"source_file": "index.md"} | [
-0.031578730791807175,
0.053093042224645615,
0.07519197463989258,
-0.013615738600492477,
0.06300201267004013,
-0.11150546371936798,
0.06002284958958626,
-0.066532664000988,
-0.02348468452692032,
-0.02566053345799446,
0.04266905039548874,
-0.00434470409527421,
0.031034186482429504,
0.055774... |
dc49499c-c03b-4b5a-bf87-db4d44e4055b | You can see how to
Insert Local Files
for more details. After we initialize the source table, we can create a RegexpTree by table source:
sql
CREATE DICTIONARY regexp_dict
(
regexp String,
name String,
version String
PRIMARY KEY(regexp)
SOURCE(CLICKHOUSE(TABLE 'regexp_dictionary_source_table'))
LIFETIME... | {"source_file": "index.md"} | [
0.07943006604909897,
-0.028120731934905052,
-0.054447486996650696,
0.016579821705818176,
-0.039030127227306366,
-0.01233948115259409,
0.04423242062330246,
-0.04000287130475044,
-0.09179017692804337,
-0.0006077451980672777,
-0.0043656183406710625,
-0.1163346916437149,
0.07878043502569199,
0... |
88b9a31e-8bab-47bf-a36e-5390ca46c87e | We recommend periodically updating the dictionaries with the geobase. During an update, generate new files and write them to a separate location. When everything is ready, rename them to the files used by the server.
There are also functions for working with OS identifiers and search engines, but they shouldn't be us... | {"source_file": "index.md"} | [
0.027961289510130882,
-0.06567435711622238,
0.025439072400331497,
-0.045839134603738785,
-0.0659560039639473,
-0.08221717178821564,
-0.044805314391851425,
-0.03992967680096626,
-0.025505872443318367,
0.010141946375370026,
0.018508942797780037,
0.06246478483080864,
0.027003386989235878,
-0.... |
c4b94cbf-cda2-42dc-9306-ef1dc726132a | description: 'Documentation for the lagInFrame window function'
sidebar_label: 'lagInFrame'
sidebar_position: 9
slug: /sql-reference/window-functions/lagInFrame
title: 'lagInFrame'
doc_type: 'reference'
lagInFrame
Returns a value evaluated at the row that is at a specified physical offset row before the current r... | {"source_file": "lagInFrame.md"} | [
0.04263802617788315,
-0.07307042926549911,
-0.04393821954727173,
0.0008238892769441009,
-0.0024672860745340586,
0.07768315821886063,
0.05247729271650314,
0.021875303238630295,
-0.0015752846375107765,
-0.026288317516446114,
0.05765340104699135,
0.029483428224921227,
-0.04043227434158325,
-0... |
9d2e8d41-f911-4512-a58b-23834a5b18f9 | Result:
response
ββββββββdateββ¬ββcloseββ¬βprevious_day_closeββ¬βdeltaββ¬βpercent_changeββ
1. β 2024-06-07 β 120.89 β 121 β -0.11 β -0.09 β
2. β 2024-06-06 β 121 β 122.44 β -1.44 β -1.18 β
3. β 2024-06-05 β 122.44 β 116.44 β 6 β 5.15 β
4. β 2024... | {"source_file": "lagInFrame.md"} | [
-0.03761488199234009,
0.11510123312473297,
0.04617238789796829,
0.06357457488775253,
-0.024647699669003487,
-0.07659503817558289,
0.011167805641889572,
-0.02927033230662346,
0.02835378237068653,
-0.008865779265761375,
0.06831610947847366,
-0.08163052797317505,
-0.021497562527656555,
-0.016... |
01834d56-4836-446f-968b-56bf09dd07ea | description: 'Documentation for the lead window function'
sidebar_label: 'lead'
sidebar_position: 10
slug: /sql-reference/window-functions/lead
title: 'lead'
doc_type: 'reference'
lead
Returns a value evaluated at the row that is offset rows after the current row within the ordered frame.
This function is similar... | {"source_file": "lead.md"} | [
-0.0195371825248003,
0.009349130094051361,
-0.06651952117681503,
-0.0032186629250645638,
-0.013746906071901321,
0.0924215093255043,
0.0322284959256649,
0.05390552058815956,
-0.034060411155223846,
-0.005308415275067091,
0.008572282269597054,
0.047681864351034164,
-0.0236436128616333,
-0.086... |
b8429356-ca2c-4466-96fc-a2798f895c87 | response title="Query"
ββfullNameββββββββββ¬βyearββ¬βcategoryββ¬βmotivationββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
1. β Anne L Huillier β 2023 β physics β for experimental methods that generate attosecond pulses of light for the study ... | {"source_file": "lead.md"} | [
-0.13364170491695404,
-0.05813859403133392,
0.022627880796790123,
0.10564921796321869,
-0.04686427861452103,
-0.010150594636797905,
-0.022778963670134544,
0.024981804192066193,
-0.06416008621454239,
0.05901974439620972,
0.0008102779393084347,
-0.08008266240358353,
-0.01278737559914589,
-0.... |
75833d04-967d-4930-919d-4ae0cb6c6f4e | description: 'Documentation for the rank window function'
sidebar_label: 'rank'
sidebar_position: 6
slug: /sql-reference/window-functions/rank
title: 'rank'
doc_type: 'reference'
rank
Ranks the current row within its partition with gaps. In other words, if the value of any row it encounters is equal to the value ... | {"source_file": "rank.md"} | [
-0.06084614619612694,
-0.07241954654455185,
0.008399910293519497,
0.00859243143349886,
-0.010923091322183609,
0.0312870591878891,
0.029368000105023384,
0.04722495377063751,
0.015887340530753136,
-0.010303456336259842,
-0.028415922075510025,
0.01185525767505169,
0.03410044312477112,
-0.0515... |
0008e466-8120-41e3-a95f-ea4474ead7bc | description: 'Documentation for the leadInFrame window function'
sidebar_label: 'leadInFrame'
sidebar_position: 10
slug: /sql-reference/window-functions/leadInFrame
title: 'leadInFrame'
doc_type: 'reference'
leadInFrame
Returns a value evaluated at the row that is offset rows after the current row within the orde... | {"source_file": "leadInFrame.md"} | [
-0.004920397885143757,
-0.02830425463616848,
-0.06455644965171814,
0.0029354991856962442,
0.0015276470221579075,
0.07845961302518845,
0.0417005829513073,
0.030704256147146225,
-0.03686300292611122,
-0.009447498247027397,
0.012251405045390129,
0.046248454600572586,
-0.0439331941306591,
-0.0... |
84ad6006-ab88-4fa7-928b-16c27fa4dce8 | Result:
response
ββfullNameββββββββββ¬βyearββ¬βcategoryββ¬βmotivationββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
1. β Anne L Huillier β 2023 β physics β for experimental methods that generate attosecond pulses of light for the study of e... | {"source_file": "leadInFrame.md"} | [
-0.13776496052742004,
-0.03256416693329811,
0.02959732711315155,
0.10809742659330368,
-0.040329452604055405,
0.004213058389723301,
-0.0067359465174376965,
0.021112922579050064,
-0.05936373770236969,
0.04581531137228012,
0.009565467946231365,
-0.09350914508104324,
-0.006235672160983086,
-0.... |
132cd7c3-d39c-4143-a697-18d513bde113 | description: 'Documentation for the percent_rank window function'
sidebar_label: 'percent_rank'
sidebar_position: 8
slug: /sql-reference/window-functions/percent_rank
title: 'percent_rank'
doc_type: 'reference'
percent_rank
returns the relative rank (i.e. percentile) of rows within a window partition.
Syntax
... | {"source_file": "percent_rank.md"} | [
0.002775783184915781,
0.02044142782688141,
-0.07131755352020264,
-0.000011042631740565412,
-0.04555613547563553,
0.03675279766321182,
0.03598250448703766,
0.10134386271238327,
-0.021107276901602745,
-0.004204204306006432,
0.0003766543813981116,
-0.011904537677764893,
0.039538051933050156,
... |
7731d096-9e59-44b7-8275-d18c52497ec5 | description: 'Documentation for the first_value window function'
sidebar_label: 'first_value'
sidebar_position: 3
slug: /sql-reference/window-functions/first_value
title: 'first_value'
doc_type: 'reference'
first_value
Returns the first value evaluated within its ordered frame. By default, NULL arguments are skip... | {"source_file": "first_value.md"} | [
-0.015517989173531532,
0.019495774060487747,
-0.027371296659111977,
0.019758334383368492,
-0.04284827411174774,
0.04848676547408104,
0.09729170799255371,
0.03356228396296501,
0.026657545939087868,
-0.02576623298227787,
0.038249462842941284,
-0.01629728451371193,
-0.02649971842765808,
-0.06... |
35f6920d-5c81-4cd3-80da-ba733079928c | description: 'Documentation for the lag window function'
sidebar_label: 'lag'
sidebar_position: 9
slug: /sql-reference/window-functions/lag
title: 'lag'
doc_type: 'reference'
lag
Returns a value evaluated at the row that is at a specified physical offset before the current row within the ordered frame.
This funct... | {"source_file": "lag.md"} | [
0.028579551726579666,
-0.041512373834848404,
-0.048873625695705414,
0.01637144573032856,
-0.008695447817444801,
0.05011390894651413,
0.04333988577127457,
0.03442934900522232,
-0.0008404005784541368,
-0.04019347205758095,
0.04239976033568382,
0.03905022516846657,
-0.04582170769572258,
-0.08... |
d29b572f-12bd-4f41-9bbe-8d717f41ac74 | description: 'Documentation for the last_value window function'
sidebar_label: 'last_value'
sidebar_position: 4
slug: /sql-reference/window-functions/last_value
title: 'last_value'
doc_type: 'reference'
last_value
Returns the last value evaluated within its ordered frame. By default, NULL arguments are skipped, h... | {"source_file": "last_value.md"} | [
0.0036911724600940943,
0.0452982634305954,
-0.026703251525759697,
-0.002332191914319992,
-0.026714805513620377,
0.06179897487163544,
0.07399211823940277,
0.04659305140376091,
0.0320243239402771,
-0.004690338391810656,
0.030811013653874397,
-0.002353319665417075,
-0.03088739700615406,
-0.05... |
ddb8d184-c484-49ec-b056-f0d01a70fdf9 | description: 'Overview page for window functions'
sidebar_label: 'Window Functions'
sidebar_position: 1
slug: /sql-reference/window-functions/
title: 'Window Functions'
doc_type: 'reference'
Window functions
Window functions let you perform calculations across a set of rows that are related to the current row.
So... | {"source_file": "index.md"} | [
-0.019833393394947052,
-0.04204539954662323,
-0.03172173723578453,
0.01680314540863037,
-0.07121693342924118,
0.0359375961124897,
0.008811268955469131,
0.019743015989661217,
-0.0682593509554863,
0.018039003014564514,
-0.028926340863108635,
-0.002184935612604022,
0.010078703984618187,
-0.04... |
45036a0d-98be-4df3-9377-21245c232acb | | Feature | Supported? |
|---------------------------------------------------------------... | {"source_file": "index.md"} | [
-0.018640635535120964,
-0.03240098059177399,
-0.04182058572769165,
-0.02038496918976307,
-0.003144376678392291,
0.07564835250377655,
-0.0680965781211853,
0.043568555265665054,
-0.11991782486438751,
-0.0946975126862526,
0.058618735522031784,
-0.02805519476532936,
-0.025649510324001312,
-0.0... |
66ea1fb2-df0f-4272-8a30-c47a49b2a335 | |
rank()
,
dense_rank()
,
row_number()
| β
Alias:
denseRank()
|
|
percent_rank()
| β
Effic... | {"source_file": "index.md"} | [
-0.021059412509202957,
-0.09590313583612442,
-0.047290608286857605,
-0.03952465578913689,
0.018873384222388268,
0.04178230091929436,
0.00925656221807003,
0.05823509022593498,
-0.025073204189538956,
0.01408616453409195,
0.056746166199445724,
-0.03818393498659134,
0.03601288050413132,
-0.020... |
2a2672bc-1c6a-4d4b-9998-3cb4a06ee296 | ClickHouse-specific window functions {#clickhouse-specific-window-functions}
There is also the following ClickHouse specific window function:
nonNegativeDerivative(metric_column, timestamp_column[, INTERVAL X UNITS]) {#nonnegativederivativemetric_column-timestamp_column-interval-x-units}
Finds non-negative deriva... | {"source_file": "index.md"} | [
-0.01589454524219036,
0.013439852744340897,
0.027255503460764885,
0.005185549147427082,
-0.042001873254776,
-0.06605325639247894,
0.06536015123128891,
0.032550256699323654,
0.048844899982213974,
-0.008139591664075851,
0.03284969925880432,
-0.08116596192121506,
0.00975461583584547,
-0.01631... |
0c5265e8-7e7a-4298-9009-bcb4ac786c32 | Numbering rows {#numbering-rows}
``sql
CREATE TABLE salaries
(
team
String,
player
String,
salary
UInt32,
position` String
)
Engine = Memory;
INSERT INTO salaries FORMAT Values
('Port Elizabeth Barbarians', 'Gary Chen', 195000, 'F'),
('New Coreystad Archdukes', 'Charles Juarez', 190000, 'F'),
('Port Eli... | {"source_file": "index.md"} | [
0.024284616112709045,
-0.02268172614276409,
-0.010341164655983448,
-0.003822376485913992,
-0.08472256362438202,
0.09335401654243469,
0.01994890347123146,
0.05041401460766792,
-0.04972280561923981,
0.024111811071634293,
-0.01144439447671175,
0.010985473170876503,
0.07604818046092987,
-0.036... |
46e89902-3fcc-4f60-9d95-f2353be2f6ca | Partitioning by column {#partitioning-by-column}
``sql
CREATE TABLE wf_partition
(
part_key
UInt64,
value
UInt64,
order` UInt64
)
ENGINE = Memory;
INSERT INTO wf_partition FORMAT Values
(1,1,1), (1,2,2), (1,3,3), (2,0,0), (3,0,0);
SELECT
part_key,
value,
order,
groupArray(value) OVER (PARTIT... | {"source_file": "index.md"} | [
0.04721938073635101,
-0.053794652223587036,
-0.05320371687412262,
0.021117888391017914,
-0.014317587949335575,
-0.012895707972347736,
0.08487959951162338,
0.01755855605006218,
-0.040819574147462845,
-0.0354791097342968,
-0.0415552593767643,
0.04350346699357033,
-0.05592409521341324,
-0.022... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.