Expand description
Diesel query-builder extensions for ClickHouse.
This crate follows the same shape as small Diesel extension crates such as
diesel-paradedb: it adds typed AST nodes for SQL that Diesel does not know
about natively. The ClickHouse backend is a lightweight SQL-rendering
backend, so regular Diesel expressions can be rendered with ClickHouse-style
identifiers and placeholders while ClickHouse-only functions, operators and
trailing clauses compose with the usual select / filter / order calls.
§Quick start
use diesel::prelude::*;
use diesel_clickhouse::{
count_if, format, limit_by_col, quantile, to_start_of_hour, ClickHouse,
ClickHouseQueryDsl, Format,
};
let query = events::table
.select((
to_start_of_hour(events::created_at),
count_if(events::success.eq(true)),
quantile(0.95, events::latency_ms),
))
.filter(events::tenant_id.eq("acme"))
.group_by(to_start_of_hour(events::created_at))
.order(to_start_of_hour(events::created_at).desc())
.limit_by_col(10, "tenant_id")
.format(Format::JsonEachRow);
let sql = diesel_clickhouse::to_sql(&query)?;§Scope
This crate focuses on building ClickHouse SQL from Diesel ASTs and now
includes an initial HTTP-backed ClickHouseConnection plus explicit
ClickHouseConnectionOptions for idiomatic Diesel load/execute/batch_execute workflows. You can still execute rendered SQL through your
ClickHouse client of choice when you need client-specific behavior.
§Guides
Long-form Markdown guides from ./docs/ are rendered under docs on
docs.rs:
docs::usagefor usage guidance.docs::tutorialfor the NYC taxi tutorial translated to Diesel.docs::feature_matrixfor the implementation checklist.docs::connection_designfor connection design notes.
Modules§
- docs
- Long-form Markdown guides rendered in the rustdoc item tree.
- sql_
types - ClickHouse SQL-type markers for use in
table!declarations and explicitselecttype annotations.
Structs§
- Aggregate
Builder - Builder for ClickHouse aggregate function names plus combinator suffixes.
- Aggregate
Call - A ClickHouse aggregate call such as
sumIf(x, cond)oravgOrNullIf(x, cond). - Aggregate
IfArgs - Existing aggregate arguments plus a trailing
Ifcondition. - Alter
Table ALTER TABLE ...statement with one operation.- Array
Join FROM table ARRAY JOIN exprquery source wrapper.- Binary
Parametric Aggregate - Renderer for ClickHouse parametric aggregates with two expression arguments:
function(param, ...)(left, right). - Buffer
Engine Buffer(database, table, ...)engine definition.- Cast
Function - A ClickHouse cast-like function call with caller-provided result SQL type.
- Click
House - Diesel backend marker for ClickHouse SQL rendering.
- Click
House Connection - A synchronous Diesel connection for ClickHouse over HTTP.
- Click
House Connection Options - Explicit configuration for establishing a
ClickHouseConnection. - Click
House Field - Field view returned from
ClickHouseRow. - Click
House Join - A ClickHouse-specific join source.
- Click
House Join Builder - Builder for ClickHouse’s extended join syntax.
- Click
House Query Builder - Query builder that renders ClickHouse-style SQL.
- Click
House Row - Owned result row used by the ClickHouse connection.
- Click
House Transaction Manager - Transaction manager that makes unsupported ClickHouse transactions explicit.
- Click
House Type Metadata - Minimal type metadata used by the bind collector.
- Column
- One ClickHouse column definition.
- Create
Materialized View CREATE MATERIALIZED VIEW ... AS SELECT ...statement.- Create
Materialized View Builder - Builder for
CREATE MATERIALIZED VIEWbefore theAS SELECTquery is known. - Create
Table CREATE TABLE ...statement.- Distributed
Engine Distributed(cluster, database, table[, sharding_key[, policy_name]])engine definition.- Engine
Setting - One
SETTINGS name = valueitem in an engine definition. - Fill
Bound - One optional
WITH FILLbound. - Final
FROM table FINALquery source wrapper.- Formatted
Query - Query wrapper that appends a ClickHouse
FORMATclause. - Group
ByAll GROUP BY ALLmarker.- Group
ByModifier - Generic wrapper for ClickHouse-specific
GROUP BYmodifiers. - Grouping
GROUPING(expr, ...)scalar function.- Grouping
Sets GROUP BY GROUPING SETS ((...), (...), ...)marker.- Higher
Order Function - A higher-order function call of the shape
function(lambda, expr). - Into
Outfile Query - Query wrapper that appends ClickHouse’s
INTO OUTFILEclause. - JoinOn
ON predicatejoin constraint.- Join
Using USING (columns...)join constraint.- Json
Path Function - Render a JSON function with
json[, indices_or_keys]...shape. - Lambda
- Raw lambda expression used by higher-order ClickHouse functions.
- LimitBy
- Query wrapper that appends
LIMIT ... BY .... - Limit
With Ties - Query wrapper that appends
WITH TIESafterLIMIT. - Merge
Tree - MergeTree-family engine definition.
- Mutation
Assignment - One
column = exprassignment in anALTER TABLE ... UPDATEmutation. - Nested
Field - One field in a ClickHouse
Nested(...)DDL type. - NoAggregate
Args - No arguments, useful for
count()andcountIf(cond). - NoFill
Bound - Missing
WITH FILLbound. - NoSample
Offset - No
SAMPLE OFFSETclause. - NoWindow
Bindings - Empty named window binding list.
- NoWindow
Frame - Missing frame clause.
- NoWindow
Order - Missing
ORDER BYpart. - NoWindow
Partition - Missing
PARTITION BYpart. - NoWith
Bindings - Empty scalar
WITHbinding list. - OneAggregate
Arg - One aggregate argument.
- Over
expr OVER (...)wrapper.- Over
Window expr OVER window_namewrapper.- Parametric
Aggregate - Generic renderer for ClickHouse’s parametric aggregate syntax:
function(param, ...)(expr). - Prewhere
FROM table PREWHERE predicatequery source wrapper.- Qualify
Query - Query wrapper that appends
QUALIFY predicate. - Sample
FROM table SAMPLE ratio [OFFSET offset]query source wrapper.- Sample
Offset OFFSET exprpart of a ClickHouseSAMPLEclause.- Setting
- One
SETTINGS name = valueentry. UseSetting::flagfor ClickHouse’s boolean shorthand (SETTINGS some_flag). - Settings
Query - Query wrapper that appends a ClickHouse
SETTINGSclause. - Table
Index - One
INDEX name expr TYPE ... [GRANULARITY n]definition inCREATE TABLE. - Table
Projection - One
PROJECTION name (SELECT ...)definition inCREATE TABLEorALTER TABLE. - TwoAggregate
Args - Two aggregate arguments, e.g.
argMax(arg, value). - Vector
Bytes - ClickHouse binary-vector reinterpret expression.
- Vector
Literal - ClickHouse vector literal rendered as
[x, y, ...]. - Vector
Similarity Index - Parameters for ClickHouse’s
vector_similarity(...)skipping index. - Window
Binding - One named window binding plus previously declared bindings.
- Window
Frame ROWSorRANGEframe clause for a window specification.- Window
Order ORDER BY exprpart.- Window
Partition PARTITION BY exprpart.- Window
Query - Query wrapper that appends named window definitions.
- Window
Spec - Inline window specification.
- With
Binding - One scalar
WITH expr AS aliasbinding plus previously declared bindings. - With
CteBinding - One
WITH alias AS [MATERIALIZED] (subquery)binding. - With
Fill expr WITH FILL [FROM x] [TO y] [STEP z].- With
Query - Query wrapper that prepends ClickHouse scalar
WITHaliases.
Enums§
- Array
Join Kind - Which ClickHouse ARRAY JOIN form to render.
- Data
Type - ClickHouse data type syntax for DDL.
- Engine
Setting Value - Literal value in a MergeTree
SETTINGSclause. - Format
- Supported ClickHouse output formats.
- Group
ByModifier Kind - Which modifier syntax to render around or after the grouping expression.
- Index
Type - Supported ClickHouse table index type renderers.
- Join
Kind - ClickHouse join kind.
- Join
Modifier - Optional ClickHouse join result modifier.
- Join
Strictness - ClickHouse join strictness modifier.
- Json
Path Segment - One ClickHouse JSON path argument: either an object key or an array index.
- Outfile
Compression - Compression algorithms supported by ClickHouse
INTO OUTFILE. - Outfile
Mode - Existing-file behavior for
INTO OUTFILE. - Partition
Expr - ClickHouse partition expression for
ALTER TABLE ... PARTITIONoperations. - Setting
Value - Literal value in a ClickHouse
SETTINGSclause. - Table
Engine - Supported table engine builders.
- Vector
Bytes Encoding - How the input expression should be decoded before reinterpretation.
- Vector
Distance Function - Distance functions accepted by
vector_similarity(...)indexes. - Vector
Index Algorithm - Vector index implementation.
- Vector
Quantization - Quantization values accepted by
vector_similarity(...)indexes. - Window
Frame Bound - One boundary in a ClickHouse window frame.
- Window
Frame Units - Window frame units.
Traits§
- Click
House Join Dsl - Fluent
.clickhouse_join(rhs)entry point. - Click
House Query Dsl - Extension methods for final ClickHouse query modifiers.
- Click
House Text Expression Methods - ClickHouse-specific methods for text predicates that Diesel does not expose generically.
- Global
InDsl - Fluent
.global_in(rhs)for ClickHouse distributed subquery membership. - NotGlobal
InDsl - Fluent
.not_global_in(rhs)forGLOBAL NOT IN. - OverDsl
- Fluent
.over_ch(spec)and.over_window(name)helpers for window functions.
Functions§
- abs
abs(expr).- accurate_
cast - Render
accurateCast(expr, 'Type')and mark the expression as SQL typeST. - accurate_
cast_ or_ default - Render
accurateCastOrDefault(expr, 'Type')and mark the expression asST. - accurate_
cast_ or_ null - Render
accurateCastOrNull(expr, 'Type')asNullable<ST>. - aggregate
- Start a generic ClickHouse aggregate/combinator call.
- aggregating_
merge_ tree - Start an
AggregatingMergeTreeengine definition. - all_
partitions - Build ClickHouse’s
PARTITION ALLexpression where supported. - alter_
table - Start an
ALTER TABLEstatement. - analysis_
of_ variance analysisOfVariance(value, group_no).- any_
last anyLast(expr).- any_
value any(expr).- approx_
top_ sum - Build
approx_top_sum(n)(value, weight). - approx_
top_ sum_ with_ reserved - Build
approx_top_sum(n, reserved)(value, weight). - arg_max
argMax(arg, val).- arg_min
argMin(arg, val).- array_
all - Render
arrayAll(lambda, array). - array_
concat arrayConcat(left, right).- array_
count - Render
arrayCount(lambda, array). - array_
distinct arrayDistinct(array).- array_
element arrayElement(array, index).- array_
exists - Render
arrayExists(lambda, array). - array_
filter - Render
arrayFilter(lambda, array). - array_
join arrayJoin(array)— expression form of ClickHouse ARRAY JOIN.- array_
join_ clause - Wrap a table or subquery with ClickHouse’s
ARRAY JOINclause. - array_
join_ clause_ as - Wrap a table or subquery with
ARRAY JOIN expr AS alias. - array_
map - Render
arrayMap(lambda, array)returning the same array type as the input. - array_
map_ as - Render
arrayMap(lambda, array)with an explicit result element type. - avg_if
avgIf(expr, predicate).- avg_
merge avgMerge(state).- avg_
merge_ state avgMergeState(state).- avg_
state avgState(expr).- base64_
decode base64Decode(expr).- base64_
encode base64Encode(expr).- buffer
- Build a
Buffer(...)engine definition. - cast
- Render
CAST(expr, 'Type')and mark the expression as SQL typeST. - ceil
ceil(expr).- city_
hash64 cityHash64(expr).- clickhouse_
join - Start building a ClickHouse-specific join source.
- collapsing_
merge_ tree - Start a
CollapsingMergeTree(sign)engine definition. - concat
concat(left, right).- corr
corr(x, y).- cosine_
distance cosineDistance(vector1, vector2).- count_
if countIf(predicate).- count_
merge countMerge(state).- count_
merge_ state countMergeState(state).- count_
state countState().- covar_
pop covarPop(x, y).- covar_
pop_ stable covarPopStable(x, y).- covar_
samp covarSamp(x, y).- covar_
samp_ stable covarSampStable(x, y).- create_
materialized_ view - Start a
CREATE MATERIALIZED VIEWstatement. - create_
table - Start a
CREATE TABLEstatement. - cube
- Render
GROUP BY CUBE(expr). - cut_
query_ string cutQueryString(url).- date_
diff dateDiff(unit, start, end).- date_
trunc dateTrunc(unit, expr).- dense_
rank dense_rank().- distributed
- Build a
Distributed(cluster, database, table)engine definition. - domain
domain(url).- domain_
without_ www domainWithoutWWW(url).- empty
empty(expr).- farm_
fingerprint64 farmFingerprint64(expr).- final_
table - Wrap a table or subquery with ClickHouse’s
FINALmodifier. - finalize_
aggregation finalizeAggregation(state).- first_
significant_ subdomain firstSignificantSubdomain(url).- first_
value first_value(expr).- floor
floor(expr).- format
- Append
FORMAT <format>to a query. - greatest
greatest(left, right).- group_
array groupArray(expr).- group_
array_ if groupArrayIf(expr, predicate).- group_
array_ merge groupArrayMerge(state).- group_
array_ state groupArrayState(expr).- group_
by_ all - Render
GROUP BY ALL. - grouping
- Render
GROUPING(expr). - grouping_
sets - Render
GROUP BY GROUPING SETS ((col_a), (col_b), ()). - has
has(array, value).- has_all
hasAll(left, right).- has_any
hasAny(left, right).- hex
hex(expr).- histogram
- Build a
histogram(bins)(expr)aggregate expression. - if_
if(cond, then_expr, else_expr).- ilike
ilike(haystack, pattern)function form ofhaystack ILIKE pattern.- ilike_
escape ilike(haystack, pattern, escape)with a custom escape character.- int_div
intDiv(left, right).- into_
outfile - Append ClickHouse’s
INTO OUTFILE file_nameclause to a query. - ipv4_
num_ to_ string IPv4NumToString(expr).- ipv4_
string_ to_ num IPv4StringToNum(expr).- ipv6_
num_ to_ string IPv6NumToString(expr).- is_
ipv4_ string isIPv4String(expr).- is_
ipv6_ string isIPv6String(expr).- is_
not_ null isNotNull(expr).- is_null
isNull(expr).- is_
valid_ json isValidJSON(json).- json_
exists JSON_EXISTS(json, path).- json_
extract_ bool JSONExtractBool(json, key).- json_
extract_ bool_ path - Render
JSONExtractBool(json, path...). - json_
extract_ float JSONExtractFloat(json, key).- json_
extract_ float_ path - Render
JSONExtractFloat(json, path...). - json_
extract_ int JSONExtractInt(json, key).- json_
extract_ int_ ci JSONExtractIntCaseInsensitive(json, key).- json_
extract_ int_ ci_ path - Render
JSONExtractIntCaseInsensitive(json, path...). - json_
extract_ int_ path - Render
JSONExtractInt(json, path...). - json_
extract_ raw JSONExtractRaw(json, key).- json_
extract_ raw_ ci JSONExtractRawCaseInsensitive(json, key).- json_
extract_ raw_ ci_ path - Render
JSONExtractRawCaseInsensitive(json, path...). - json_
extract_ raw_ path - Render
JSONExtractRaw(json, path...). - json_
extract_ string JSONExtractString(json, key).- json_
extract_ string_ ci JSONExtractStringCaseInsensitive(json, key).- json_
extract_ string_ ci_ path - Render
JSONExtractStringCaseInsensitive(json, path...). - json_
extract_ string_ path - Render
JSONExtractString(json, path...). - json_
extract_ uint JSONExtractUInt(json, key).- json_
extract_ uint_ path - Render
JSONExtractUInt(json, path...). - json_
has JSONHas(json, key).- json_
length JSONLength(json).- json_
query JSON_QUERY(json, path).- json_
value JSON_VALUE(json, path).- l1_
distance L1Distance(vector1, vector2).- l1_norm
L1Norm(vector).- l2_
distance L2Distance(vector1, vector2).- l2_norm
L2Norm(vector).- lag
lag(expr).- lag_
in_ frame lagInFrame(expr, offset, default).- lambda
- Build a single-argument ClickHouse lambda, e.g.
x -> x + 1. - lambda2
- Build a two-argument ClickHouse lambda, e.g.
(k, v) -> v > 0. - lambda_
params - Build a ClickHouse lambda from an arbitrary parameter list.
- last_
value last_value(expr).- lead
lead(expr).- lead_
in_ frame leadInFrame(expr, offset, default).- least
least(left, right).- left_
array_ join_ clause - Wrap a table or subquery with ClickHouse’s
LEFT ARRAY JOINclause. - left_
array_ join_ clause_ as - Wrap a table or subquery with
LEFT ARRAY JOIN expr AS alias. - length
length(expr).- like
like(haystack, pattern)function form ofhaystack LIKE pattern.- like_
escape like(haystack, pattern, escape)with a custom escape character.- limit_
by_ col - Append
LIMIT n BY columnto a query. - linf_
distance LinfDistance(vector1, vector2).- linf_
norm LinfNorm(vector).- lower
lower(expr).- mann_
whitney_ u_ test mannWhitneyUTest(sample_data, sample_index).- map_
apply - Render
mapApply(lambda, map)returning the same map type as the input. - map_
contains mapContains(map, key).- map_
filter - Render
mapFilter(lambda, map). - map_
from_ arrays mapFromArrays(keys, values).- map_
keys mapKeys(map).- map_
values mapValues(map).- max_if
maxIf(expr, predicate).- max_
merge maxMerge(state).- max_
state maxState(expr).- merge_
tree - Start a
MergeTreeengine definition. - min_if
minIf(expr, predicate).- min_
merge minMerge(state).- min_
state minState(expr).- multi_
fuzzy_ match_ all_ indices multiFuzzyMatchAllIndices(haystack, distance, patterns).- multi_
fuzzy_ match_ any multiFuzzyMatchAny(haystack, distance, patterns).- multi_
fuzzy_ match_ any_ index multiFuzzyMatchAnyIndex(haystack, distance, patterns).- multi_
match_ all_ indices multiMatchAllIndices(haystack, patterns).- multi_
match_ any multiMatchAny(haystack, patterns).- multi_
match_ any_ index multiMatchAnyIndex(haystack, patterns).- mutation_
assignment - Build one
ALTER TABLE ... UPDATE column = exprassignment. - not_
empty notEmpty(expr).- not_
ilike notILike(haystack, pattern)function form ofhaystack NOT ILIKE pattern.- not_
ilike_ escape notILike(haystack, pattern, escape)with a custom escape character.- not_
like notLike(haystack, pattern)function form ofhaystack NOT LIKE pattern.- not_
like_ escape notLike(haystack, pattern, escape)with a custom escape character.- partition_
by - Build a window spec with
PARTITION BY expr. - partition_
expr - Build a raw partition expression for
ALTER TABLE ... PARTITIONoperations. - partition_
id - Build a
PARTITION ID '...'expression. - position
position(haystack, needle).- prewhere
- Wrap a table or subquery with ClickHouse’s
PREWHEREclause. - projection
- Build a ClickHouse table projection definition.
- qualify
- Append
QUALIFY predicateto a query. - quantile
- Build a
quantile(level)(expr)aggregate expression. - quantile_
deterministic - Build a
quantileDeterministic(level)(expr, determinator)aggregate expression. - quantile_
exact - Build a
quantileExact(level)(expr)aggregate expression. - quantile_
tdigest - Build a
quantileTDigest(level)(expr)aggregate expression. - quantile_
timing - Build a
quantileTiming(level)(expr)aggregate expression. - quantiles
- Build a
quantiles(level, ...)(expr)aggregate expression. - quantiles_
timing - Build a
quantilesTiming(level, ...)(expr)aggregate expression. - rank
rank().- regexp_
match match(haystack, pattern).- replace_
all replaceAll(haystack, pattern, replacement).- replacing_
merge_ tree - Start a
ReplacingMergeTreeengine definition. - replacing_
merge_ tree_ with - Start a
ReplacingMergeTree(version)engine definition. - rollup
- Render
GROUP BY ROLLUP(expr). - round
round(expr).- row_
number row_number().- sample
- Wrap a table or subquery with ClickHouse’s
SAMPLE <ratio>modifier. - sample_
offset - Wrap a table or subquery with
SAMPLE <ratio> OFFSET <offset>. - settings
- Append
SETTINGS ...to a query. - simple_
json_ extract_ float simpleJSONExtractFloat(json, field_name).- simple_
json_ extract_ int simpleJSONExtractInt(json, field_name).- simple_
json_ extract_ string simpleJSONExtractString(json, field_name).- simple_
json_ has simpleJSONHas(json, field_name).- sip_
hash64 sipHash64(expr).- stddev_
pop stddevPop(x).- stddev_
pop_ stable stddevPopStable(x).- stddev_
samp stddevSamp(x).- stddev_
samp_ stable stddevSampStable(x).- substring
substring(expr, offset, length).- sum_if
sumIf(expr, predicate).- sum_
merge sumMerge(state).- sum_
merge_ state sumMergeState(state).- sum_
state sumState(expr).- summing_
merge_ tree - Start a
SummingMergeTreeengine definition. - summing_
merge_ tree_ with - Start a
SummingMergeTree((columns...))engine definition. - to_bool
toBool(expr).- to_date
toDate(expr).- to_
date_ time toDateTime(expr).- to_
date_ time64 toDateTime64(expr, scale).- to_
day_ of_ month toDayOfMonth(expr).- to_
float32 toFloat32(expr).- to_
float64 toFloat64(expr).- to_
float64_ or_ null toFloat64OrNull(expr).- to_
float64_ or_ zero toFloat64OrZero(expr).- to_hour
toHour(expr).- to_int8
toInt8(expr).- to_
int16 toInt16(expr).- to_
int32 toInt32(expr).- to_
int64 toInt64(expr).- to_
int32_ or_ null toInt32OrNull(expr).- to_
int64_ or_ null toInt64OrNull(expr).- to_
int64_ or_ zero toInt64OrZero(expr).- to_
int128 toInt128(expr).- to_
int256 toInt256(expr).- to_ipv4
toIPv4(expr).- to_ipv6
toIPv6(expr).- to_
minute toMinute(expr).- to_
month toMonth(expr).- to_sql
- Render any Diesel AST node as ClickHouse SQL without the debug bind comment.
- to_
start_ of_ day toStartOfDay(expr).- to_
start_ of_ hour toStartOfHour(expr).- to_
start_ of_ minute toStartOfMinute(expr).- to_
start_ of_ month toStartOfMonth(expr).- to_
start_ of_ year toStartOfYear(expr).- to_
string toString(expr).- to_
uint8 toUInt8(expr).- to_
uint16 toUInt16(expr).- to_
uint32 toUInt32(expr).- to_
uint64 toUInt64(expr).- to_
uint32_ or_ null toUInt32OrNull(expr).- to_
uint64_ or_ null toUInt64OrNull(expr).- to_
uint64_ or_ zero toUInt64OrZero(expr).- to_
uint128 toUInt128(expr).- to_
uint256 toUInt256(expr).- to_
unix_ timestamp toUnixTimestamp(expr).- to_year
toYear(expr).- top_k
- Build a
topK(k)(expr)aggregate expression. - top_
level_ domain topLevelDomain(url).- try_
base64_ decode tryBase64Decode(expr).- unhex
unhex(expr).- uniq
uniq(expr).- uniq_
exact uniqExact(expr).- uniq_
exact_ if uniqExactIf(expr, predicate).- uniq_
exact_ merge uniqExactMerge(state).- uniq_
exact_ state uniqExactState(expr).- uniq_if
uniqIf(expr, predicate).- uniq_
merge uniqMerge(state).- uniq_
state uniqState(expr).- upper
upper(expr).- url_
fragment fragment(url).- url_
path path(url).- url_
path_ full pathFull(url).- url_
protocol protocol(url).- url_
query_ string queryString(url).- var_pop
varPop(x).- var_
pop_ stable varPopStable(x).- var_
samp varSamp(x).- var_
samp_ stable varSampStable(x).- vector_
f32 - Build a ClickHouse array literal typed as
Array(Float32). - vector_
f64 - Build a ClickHouse array literal typed as
Array(Float64). - vector_
f32_ binary - Reinterpret a binary string expression as
Array(Float32). - vector_
f32_ hex - Decode a hex string expression with
unhexand reinterpret it asArray(Float32). - vector_
f32_ le_ bytes - Convert
f32vector values into ClickHouse-compatible little-endian bytes. - vector_
f32_ le_ hex - Convert
f32vector values into a lower-case hex string of little-endian bytes. - vector_
f64_ binary - Reinterpret a binary string expression as
Array(Float64). - vector_
f64_ hex - Decode a hex string expression with
unhexand reinterpret it asArray(Float64). - vector_
f64_ le_ bytes - Convert
f64vector values into ClickHouse-compatible little-endian bytes. - vector_
f64_ le_ hex - Convert
f64vector values into a lower-case hex string of little-endian bytes. - vector_
similarity_ index - Build a ClickHouse
vector_similarityskipping index. - versioned_
collapsing_ merge_ tree - Start a
VersionedCollapsingMergeTree(sign, version)engine definition. - window
- Append
WINDOW name AS (spec)to a query. - window_
order_ by - Build a window spec with
ORDER BY exprand no partition key. - with_
alias - Prepend a scalar
WITH expr AS aliasbinding to a query. - with_
cte - Prepend a common table expression binding to a query.
- with_
fill - Wrap an
ORDER BYexpression with ClickHouse’sWITH FILLmodifier. - with_
materialized_ cte - Prepend a materialized common table expression binding to a query.
- with_
ties - Append
WITH TIESafter a ClickHouseLIMITclause. - with_
totals - Render
GROUP BY expr WITH TOTALS. - xx_
hash64 xxHash64(expr).
Type Aliases§
- Approx
TopSum Item - Result type returned by
approx_top_sumfor one value/weight pair. - Approx
TopSum Result approx_top_sumresult array element type.- Click
House Cursor - Iterator returned by
ClickHouseConnectionload operations. - Histogram
histogram(bins)(expr)adaptive histogram aggregate.- Histogram
Bucket - SQL type of each tuple returned by ClickHouse
histogram. - Quantile
quantile(level)(expr)— ClickHouse’s parametric approximate quantile.- Rows
Between Unbounded Preceding AndCurrent Row - Backwards-compatible name for the original frame helper return type.
- abs
- The return type of
abs() - analysis_
of_ variance - The return type of
analysis_of_variance() - any_
last - The return type of
any_last() - any_
value - The return type of
any_value() - arg_max
- The return type of
arg_max() - arg_min
- The return type of
arg_min() - array_
concat - The return type of
array_concat() - array_
distinct - The return type of
array_distinct() - array_
element - The return type of
array_element() - array_
join - The return type of
array_join() - avg_if
- The return type of
avg_if() - avg_
merge - The return type of
avg_merge() - avg_
merge_ state - The return type of
avg_merge_state() - avg_
state - The return type of
avg_state() - base64_
decode - The return type of
base64_decode() - base64_
encode - The return type of
base64_encode() - ceil
- The return type of
ceil() - city_
hash64 - The return type of
city_hash64() - concat
- The return type of
concat() - corr
- The return type of
corr() - cosine_
distance - The return type of
cosine_distance() - count_
if - The return type of
count_if() - count_
merge - The return type of
count_merge() - count_
merge_ state - The return type of
count_merge_state() - count_
state - The return type of
count_state() - covar_
pop - The return type of
covar_pop() - covar_
pop_ stable - The return type of
covar_pop_stable() - covar_
samp - The return type of
covar_samp() - covar_
samp_ stable - The return type of
covar_samp_stable() - cut_
query_ string - The return type of
cut_query_string() - date_
diff - The return type of
date_diff() - date_
trunc - The return type of
date_trunc() - dense_
rank - The return type of
dense_rank() - domain
- The return type of
domain() - domain_
without_ www - The return type of
domain_without_www() - empty
- The return type of
empty() - farm_
fingerprint64 - The return type of
farm_fingerprint64() - finalize_
aggregation - The return type of
finalize_aggregation() - first_
significant_ subdomain - The return type of
first_significant_subdomain() - first_
value - The return type of
first_value() - floor
- The return type of
floor() - greatest
- The return type of
greatest() - group_
array - The return type of
group_array() - group_
array_ if - The return type of
group_array_if() - group_
array_ merge - The return type of
group_array_merge() - group_
array_ state - The return type of
group_array_state() - has
- The return type of
has() - has_all
- The return type of
has_all() - has_any
- The return type of
has_any() - hex
- The return type of
hex() - if_
- The return type of
if_() - ilike
- The return type of
ilike() - ilike_
escape - The return type of
ilike_escape() - int_div
- The return type of
int_div() - ipv4_
num_ to_ string - The return type of
ipv4_num_to_string() - ipv4_
string_ to_ num - The return type of
ipv4_string_to_num() - ipv6_
num_ to_ string - The return type of
ipv6_num_to_string() - is_
ipv4_ string - The return type of
is_ipv4_string() - is_
ipv6_ string - The return type of
is_ipv6_string() - is_
not_ null - The return type of
is_not_null() - is_null
- The return type of
is_null() - is_
valid_ json - The return type of
is_valid_json() - json_
exists - The return type of
json_exists() - json_
extract_ bool - The return type of
json_extract_bool() - json_
extract_ float - The return type of
json_extract_float() - json_
extract_ int - The return type of
json_extract_int() - json_
extract_ int_ ci - The return type of
json_extract_int_ci() - json_
extract_ raw - The return type of
json_extract_raw() - json_
extract_ raw_ ci - The return type of
json_extract_raw_ci() - json_
extract_ string - The return type of
json_extract_string() - json_
extract_ string_ ci - The return type of
json_extract_string_ci() - json_
extract_ uint - The return type of
json_extract_uint() - json_
has - The return type of
json_has() - json_
length - The return type of
json_length() - json_
query - The return type of
json_query() - json_
value - The return type of
json_value() - l1_
distance - The return type of
l1_distance() - l1_norm
- The return type of
l1_norm() - l2_
distance - The return type of
l2_distance() - l2_norm
- The return type of
l2_norm() - lag
- The return type of
lag() - lag_
in_ frame - The return type of
lag_in_frame() - last_
value - The return type of
last_value() - lead
- The return type of
lead() - lead_
in_ frame - The return type of
lead_in_frame() - least
- The return type of
least() - length
- The return type of
length() - like
- The return type of
like() - like_
escape - The return type of
like_escape() - linf_
distance - The return type of
linf_distance() - linf_
norm - The return type of
linf_norm() - lower
- The return type of
lower() - mann_
whitney_ u_ test - The return type of
mann_whitney_u_test() - map_
contains - The return type of
map_contains() - map_
from_ arrays - The return type of
map_from_arrays() - map_
keys - The return type of
map_keys() - map_
values - The return type of
map_values() - max_if
- The return type of
max_if() - max_
merge - The return type of
max_merge() - max_
state - The return type of
max_state() - min_if
- The return type of
min_if() - min_
merge - The return type of
min_merge() - min_
state - The return type of
min_state() - multi_
fuzzy_ match_ all_ indices - The return type of
multi_fuzzy_match_all_indices() - multi_
fuzzy_ match_ any - The return type of
multi_fuzzy_match_any() - multi_
fuzzy_ match_ any_ index - The return type of
multi_fuzzy_match_any_index() - multi_
match_ all_ indices - The return type of
multi_match_all_indices() - multi_
match_ any - The return type of
multi_match_any() - multi_
match_ any_ index - The return type of
multi_match_any_index() - not_
empty - The return type of
not_empty() - not_
ilike - The return type of
not_ilike() - not_
ilike_ escape - The return type of
not_ilike_escape() - not_
like - The return type of
not_like() - not_
like_ escape - The return type of
not_like_escape() - position
- The return type of
position() - rank
- The return type of
rank() - regexp_
match - The return type of
regexp_match() - replace_
all - The return type of
replace_all() - round
- The return type of
round() - row_
number - The return type of
row_number() - simple_
json_ extract_ float - The return type of
simple_json_extract_float() - simple_
json_ extract_ int - The return type of
simple_json_extract_int() - simple_
json_ extract_ string - The return type of
simple_json_extract_string() - simple_
json_ has - The return type of
simple_json_has() - sip_
hash64 - The return type of
sip_hash64() - stddev_
pop - The return type of
stddev_pop() - stddev_
pop_ stable - The return type of
stddev_pop_stable() - stddev_
samp - The return type of
stddev_samp() - stddev_
samp_ stable - The return type of
stddev_samp_stable() - substring
- The return type of
substring() - sum_if
- The return type of
sum_if() - sum_
merge - The return type of
sum_merge() - sum_
merge_ state - The return type of
sum_merge_state() - sum_
state - The return type of
sum_state() - to_bool
- The return type of
to_bool() - to_date
- The return type of
to_date() - to_
date_ time - The return type of
to_date_time() - to_
date_ time64 - The return type of
to_date_time64() - to_
day_ of_ month - The return type of
to_day_of_month() - to_
float32 - The return type of
to_float32() - to_
float64 - The return type of
to_float64() - to_
float64_ or_ null - The return type of
to_float64_or_null() - to_
float64_ or_ zero - The return type of
to_float64_or_zero() - to_hour
- The return type of
to_hour() - to_int8
- The return type of
to_int8() - to_
int16 - The return type of
to_int16() - to_
int32 - The return type of
to_int32() - to_
int64 - The return type of
to_int64() - to_
int32_ or_ null - The return type of
to_int32_or_null() - to_
int64_ or_ null - The return type of
to_int64_or_null() - to_
int64_ or_ zero - The return type of
to_int64_or_zero() - to_
int128 - The return type of
to_int128() - to_
int256 - The return type of
to_int256() - to_ipv4
- The return type of
to_ipv4() - to_ipv6
- The return type of
to_ipv6() - to_
minute - The return type of
to_minute() - to_
month - The return type of
to_month() - to_
start_ of_ day - The return type of
to_start_of_day() - to_
start_ of_ hour - The return type of
to_start_of_hour() - to_
start_ of_ minute - The return type of
to_start_of_minute() - to_
start_ of_ month - The return type of
to_start_of_month() - to_
start_ of_ year - The return type of
to_start_of_year() - to_
string - The return type of
to_string() - to_
uint8 - The return type of
to_uint8() - to_
uint16 - The return type of
to_uint16() - to_
uint32 - The return type of
to_uint32() - to_
uint64 - The return type of
to_uint64() - to_
uint32_ or_ null - The return type of
to_uint32_or_null() - to_
uint64_ or_ null - The return type of
to_uint64_or_null() - to_
uint64_ or_ zero - The return type of
to_uint64_or_zero() - to_
uint128 - The return type of
to_uint128() - to_
uint256 - The return type of
to_uint256() - to_
unix_ timestamp - The return type of
to_unix_timestamp() - to_year
- The return type of
to_year() - top_
level_ domain - The return type of
top_level_domain() - try_
base64_ decode - The return type of
try_base64_decode() - unhex
- The return type of
unhex() - uniq
- The return type of
uniq() - uniq_
exact - The return type of
uniq_exact() - uniq_
exact_ if - The return type of
uniq_exact_if() - uniq_
exact_ merge - The return type of
uniq_exact_merge() - uniq_
exact_ state - The return type of
uniq_exact_state() - uniq_if
- The return type of
uniq_if() - uniq_
merge - The return type of
uniq_merge() - uniq_
state - The return type of
uniq_state() - upper
- The return type of
upper() - url_
fragment - The return type of
url_fragment() - url_
path - The return type of
url_path() - url_
path_ full - The return type of
url_path_full() - url_
protocol - The return type of
url_protocol() - url_
query_ string - The return type of
url_query_string() - var_pop
- The return type of
var_pop() - var_
pop_ stable - The return type of
var_pop_stable() - var_
samp - The return type of
var_samp() - var_
samp_ stable - The return type of
var_samp_stable() - xx_
hash64 - The return type of
xx_hash64()