Class ClickHouseFunctions
ClickHouse-only SQL surface: the argMin/argMax aggregates, the distinct-count
uniq/uniqExact/uniqCombined/uniqHLL12 aggregates, the parameterised
quantile(level)(value)/quantiles(level...)(value) family with median, the
topK(k)(value)/topKWeighted(k)(value, weight) aggregates, the anyLast row-picking
aggregate, the sequence/funnel aggregates windowFunnel/retention/sequenceMatch,
the frame-respecting lagInFrame/leadInFrame window functions, the multi-branch
multiIf conditional (through when<T>(bool, T?)/otherwise<T>(T?)),
the string-JSON JSONExtract*/JSONHas and visitParamExtract* families
plus the JSONPath json_value/json_query/json_exists scalars and the native-JSON
JSONAllPaths/JSONAllPathsWithTypes/toJSONString functions, the merge-patch,
validation and typed-extraction additions (JSONMergePatch, JSONArrayLength,
JSONDynamicPaths/JSONSharedDataPaths with their WithTypes siblings,
JSONKey, JSONExtractKeysAndValuesRaw, JSONExtractUInt, isValidJSON and
the simpleJSONExtract* family),
the dictionary functions, the -If aggregate combinator, the distributed global_in
predicate, the numbers/numbers_mt and zeros/zeros_mt table functions
(plus generateRandom) and the server/cluster table functions
(url/s3/file/remote/remoteSecure/cluster/clusterAllReplicas),
the date conversion/part surface (toDate/toDateTime/toDate32, the
toYear/... accessors, toStartOf*, toMonday, toYYYYMM/toYYYYMMDD,
toUnixTimestamp),
and the array functions over array columns and expressions (arrayJoin, length,
has, indexOf, hasAny/hasAll, startsWith/endsWith/hasSubstr,
arrayStringConcat,
splitByChar, arraySort, arrayReverse, arrayDistinct, range,
arrayEnumerate, arrayCumSum, arraySlice, arrayPushBack), the
higher-order (lambda) array functions (arrayMap, arrayFilter, arrayExists,
arrayAll, arrayCount, arrayFirst*, arrayLast*) plus the
array-returning aggregates groupArray/groupUniqArray, the string search/edit-distance
surface (overlay, initcap, soundex, the base64Encode/base64Decode
and hex/unhex pairs, editDistance/jaroSimilarity/byteHammingDistance,
substringIndex, countSubstrings, extractGroups and the four
normalizeUTF8* forms), and the numeric functions
log2/cbrt/exp2/exp10, the special-function surface
erf/erfc/lgamma/tgamma/sigmoid/sqr/hypot, the
integral helpers gcd/lcm/intDiv/intExp2/intExp10 and the
isFinite/isInfinite/isNaN predicates, and the rounding family
(roundBankers, roundDown, roundDuration, roundAge, roundToExp2)
with its vendor bucket tables and half-to-even rule, and the date/time family
(makeDate/makeDate32/makeDateTime, now64/nowInBlock,
timeSlot/timeSlots, the sub-hour toStartOf* truncations and
toStartOfInterval, the ISO/week/year-week accessors, toModifiedJulianDay,
age/dateName, serverTimezone/timezoneOf/timezoneOffset,
toTime, timestamp and the fromUnixTimestamp* forms), with three tested
CLR-shape refusals (fromUTCTimestamp, toTime64, fromUnixTimestamp64Nano).
The catalog's numeric operator forms
(plus/minus/multiply/divide/negate) and the constant e are
deliberately not members: they are the portable CLR operators and the E
constant, which the shared translator renders as the identical ClickHouse function/expression.
Exposed through ClickHouse; every member is gated by a capability flag
and rejected by providers that do not opt in.
public class ClickHouseFunctions : CommonFunctions
- Inheritance
-
ClickHouseFunctions
- Inherited Members
- Extension Methods
Methods
accurate_cast_decimal32_or_default<TValue>(TValue?, int)
accurateCastOrDefault(value, 'Decimal(9, scale)'): the checked conversion that
returns the target zero instead of raising when the value is not exactly
representable or cannot be parsed. The scale is a compile-time constant 0..9 and forms the target type Decimal(9, scale). A null
input yields the zero. Requires a provider that supports it (ClickHouse).
public decimal? accurate_cast_decimal32_or_default<TValue>(TValue? value, int scale)
Parameters
valueTValuescaleint
Returns
Type Parameters
TValue
accurate_cast_decimal32_or_null<TValue>(TValue?, int)
accurateCastOrNull(value, 'Decimal(9, scale)'): the checked conversion that
returns NULL instead of raising when the value is not exactly representable
or cannot be parsed. The scale is a compile-time constant 0..9 and forms the target type Decimal(9, scale). A null input yields
null. Requires a provider that supports it (ClickHouse).
public decimal? accurate_cast_decimal32_or_null<TValue>(TValue? value, int scale)
Parameters
valueTValuescaleint
Returns
Type Parameters
TValue
accurate_cast_decimal32<TValue>(TValue?, int)
accurateCast(value, 'Decimal(9, scale)'): the checked conversion to Decimal(9, S).
Unlike the to* member it raises CANNOT_CONVERT_TYPE instead of
wrapping or truncating when the value is not exactly representable (300 to Int8,
12.7 to Int8, 12.34 to Float32), while an exact value such as 12.0 to Int8 is
accepted; an unparsable string still raises CANNOT_PARSE_TEXT. The scale is a compile-time constant 0..9 and forms the target type Decimal(9, scale). A null input yields null. Requires a provider
that supports it (ClickHouse).
public decimal? accurate_cast_decimal32<TValue>(TValue? value, int scale)
Parameters
valueTValuescaleint
Returns
Type Parameters
TValue
accurate_cast_decimal64_or_default<TValue>(TValue?, int)
accurateCastOrDefault(value, 'Decimal(18, scale)'): the checked conversion that
returns the target zero instead of raising when the value is not exactly
representable or cannot be parsed. The scale is a compile-time constant 0..18 and forms the target type Decimal(18, scale). A null
input yields the zero. Requires a provider that supports it (ClickHouse).
public decimal? accurate_cast_decimal64_or_default<TValue>(TValue? value, int scale)
Parameters
valueTValuescaleint
Returns
Type Parameters
TValue
accurate_cast_decimal64_or_null<TValue>(TValue?, int)
accurateCastOrNull(value, 'Decimal(18, scale)'): the checked conversion that
returns NULL instead of raising when the value is not exactly representable
or cannot be parsed. The scale is a compile-time constant 0..18 and forms the target type Decimal(18, scale). A null input yields
null. Requires a provider that supports it (ClickHouse).
public decimal? accurate_cast_decimal64_or_null<TValue>(TValue? value, int scale)
Parameters
valueTValuescaleint
Returns
Type Parameters
TValue
accurate_cast_decimal64<TValue>(TValue?, int)
accurateCast(value, 'Decimal(18, scale)'): the checked conversion to Decimal(18, S).
Unlike the to* member it raises CANNOT_CONVERT_TYPE instead of
wrapping or truncating when the value is not exactly representable (300 to Int8,
12.7 to Int8, 12.34 to Float32), while an exact value such as 12.0 to Int8 is
accepted; an unparsable string still raises CANNOT_PARSE_TEXT. The scale is a compile-time constant 0..18 and forms the target type Decimal(18, scale). A null input yields null. Requires a provider
that supports it (ClickHouse).
public decimal? accurate_cast_decimal64<TValue>(TValue? value, int scale)
Parameters
valueTValuescaleint
Returns
Type Parameters
TValue
accurate_cast_float32_or_default<TValue>(TValue?)
accurateCastOrDefault(value, 'Float32'): the checked conversion that
returns the target zero instead of raising when the value is not exactly
representable or cannot be parsed. A null
input yields the zero. Requires a provider that supports it (ClickHouse).
public float? accurate_cast_float32_or_default<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
accurate_cast_float32_or_null<TValue>(TValue?)
accurateCastOrNull(value, 'Float32'): the checked conversion that
returns NULL instead of raising when the value is not exactly representable
or cannot be parsed. A null input yields
null. Requires a provider that supports it (ClickHouse).
public float? accurate_cast_float32_or_null<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
accurate_cast_float32<TValue>(TValue?)
accurateCast(value, 'Float32'): the checked conversion to Float32.
Unlike the to* member it raises CANNOT_CONVERT_TYPE instead of
wrapping or truncating when the value is not exactly representable (300 to Int8,
12.7 to Int8, 12.34 to Float32), while an exact value such as 12.0 to Int8 is
accepted; an unparsable string still raises CANNOT_PARSE_TEXT. A null input yields null. Requires a provider
that supports it (ClickHouse).
public float? accurate_cast_float32<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
accurate_cast_float64_or_default<TValue>(TValue?)
accurateCastOrDefault(value, 'Float64'): the checked conversion that
returns the target zero instead of raising when the value is not exactly
representable or cannot be parsed. A null
input yields the zero. Requires a provider that supports it (ClickHouse).
public double? accurate_cast_float64_or_default<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
accurate_cast_float64_or_null<TValue>(TValue?)
accurateCastOrNull(value, 'Float64'): the checked conversion that
returns NULL instead of raising when the value is not exactly representable
or cannot be parsed. A null input yields
null. Requires a provider that supports it (ClickHouse).
public double? accurate_cast_float64_or_null<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
accurate_cast_float64<TValue>(TValue?)
accurateCast(value, 'Float64'): the checked conversion to Float64.
Unlike the to* member it raises CANNOT_CONVERT_TYPE instead of
wrapping or truncating when the value is not exactly representable (300 to Int8,
12.7 to Int8, 12.34 to Float32), while an exact value such as 12.0 to Int8 is
accepted; an unparsable string still raises CANNOT_PARSE_TEXT. A null input yields null. Requires a provider
that supports it (ClickHouse).
public double? accurate_cast_float64<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
accurate_cast_int16_or_default<TValue>(TValue?)
accurateCastOrDefault(value, 'Int16'): the checked conversion that
returns the target zero instead of raising when the value is not exactly
representable or cannot be parsed. A null
input yields the zero. Requires a provider that supports it (ClickHouse).
public short? accurate_cast_int16_or_default<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
accurate_cast_int16_or_null<TValue>(TValue?)
accurateCastOrNull(value, 'Int16'): the checked conversion that
returns NULL instead of raising when the value is not exactly representable
or cannot be parsed. A null input yields
null. Requires a provider that supports it (ClickHouse).
public short? accurate_cast_int16_or_null<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
accurate_cast_int16<TValue>(TValue?)
accurateCast(value, 'Int16'): the checked conversion to Int16.
Unlike the to* member it raises CANNOT_CONVERT_TYPE instead of
wrapping or truncating when the value is not exactly representable (300 to Int8,
12.7 to Int8, 12.34 to Float32), while an exact value such as 12.0 to Int8 is
accepted; an unparsable string still raises CANNOT_PARSE_TEXT. A null input yields null. Requires a provider
that supports it (ClickHouse).
public short? accurate_cast_int16<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
accurate_cast_int32_or_default<TValue>(TValue?)
accurateCastOrDefault(value, 'Int32'): the checked conversion that
returns the target zero instead of raising when the value is not exactly
representable or cannot be parsed. A null
input yields the zero. Requires a provider that supports it (ClickHouse).
public int? accurate_cast_int32_or_default<TValue>(TValue? value)
Parameters
valueTValue
Returns
- int?
Type Parameters
TValue
accurate_cast_int32_or_null<TValue>(TValue?)
accurateCastOrNull(value, 'Int32'): the checked conversion that
returns NULL instead of raising when the value is not exactly representable
or cannot be parsed. A null input yields
null. Requires a provider that supports it (ClickHouse).
public int? accurate_cast_int32_or_null<TValue>(TValue? value)
Parameters
valueTValue
Returns
- int?
Type Parameters
TValue
accurate_cast_int32<TValue>(TValue?)
accurateCast(value, 'Int32'): the checked conversion to Int32.
Unlike the to* member it raises CANNOT_CONVERT_TYPE instead of
wrapping or truncating when the value is not exactly representable (300 to Int8,
12.7 to Int8, 12.34 to Float32), while an exact value such as 12.0 to Int8 is
accepted; an unparsable string still raises CANNOT_PARSE_TEXT. A null input yields null. Requires a provider
that supports it (ClickHouse).
public int? accurate_cast_int32<TValue>(TValue? value)
Parameters
valueTValue
Returns
- int?
Type Parameters
TValue
accurate_cast_int64_or_default<TValue>(TValue?)
accurateCastOrDefault(value, 'Int64'): the checked conversion that
returns the target zero instead of raising when the value is not exactly
representable or cannot be parsed. A null
input yields the zero. Requires a provider that supports it (ClickHouse).
public long? accurate_cast_int64_or_default<TValue>(TValue? value)
Parameters
valueTValue
Returns
- long?
Type Parameters
TValue
accurate_cast_int64_or_null<TValue>(TValue?)
accurateCastOrNull(value, 'Int64'): the checked conversion that
returns NULL instead of raising when the value is not exactly representable
or cannot be parsed. A null input yields
null. Requires a provider that supports it (ClickHouse).
public long? accurate_cast_int64_or_null<TValue>(TValue? value)
Parameters
valueTValue
Returns
- long?
Type Parameters
TValue
accurate_cast_int64<TValue>(TValue?)
accurateCast(value, 'Int64'): the checked conversion to Int64.
Unlike the to* member it raises CANNOT_CONVERT_TYPE instead of
wrapping or truncating when the value is not exactly representable (300 to Int8,
12.7 to Int8, 12.34 to Float32), while an exact value such as 12.0 to Int8 is
accepted; an unparsable string still raises CANNOT_PARSE_TEXT. A null input yields null. Requires a provider
that supports it (ClickHouse).
public long? accurate_cast_int64<TValue>(TValue? value)
Parameters
valueTValue
Returns
- long?
Type Parameters
TValue
accurate_cast_int8_or_default<TValue>(TValue?)
accurateCastOrDefault(value, 'Int8'): the checked conversion that
returns the target zero instead of raising when the value is not exactly
representable or cannot be parsed. The vendor returns Int8, which the shared row reader cannot materialize, so the result is widened exactly with toInt16 and surfaced as short. A null
input yields the zero. Requires a provider that supports it (ClickHouse).
public short? accurate_cast_int8_or_default<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
accurate_cast_int8_or_null<TValue>(TValue?)
accurateCastOrNull(value, 'Int8'): the checked conversion that
returns NULL instead of raising when the value is not exactly representable
or cannot be parsed. The vendor returns Int8, which the shared row reader cannot materialize, so the result is widened exactly with toInt16 and surfaced as short. A null input yields
null. Requires a provider that supports it (ClickHouse).
public short? accurate_cast_int8_or_null<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
accurate_cast_int8<TValue>(TValue?)
accurateCast(value, 'Int8'): the checked conversion to Int8.
Unlike the to* member it raises CANNOT_CONVERT_TYPE instead of
wrapping or truncating when the value is not exactly representable (300 to Int8,
12.7 to Int8, 12.34 to Float32), while an exact value such as 12.0 to Int8 is
accepted; an unparsable string still raises CANNOT_PARSE_TEXT. The vendor returns Int8, which the shared row reader cannot materialize, so the result is widened exactly with toInt16 and surfaced as short. A null input yields null. Requires a provider
that supports it (ClickHouse).
public short? accurate_cast_int8<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
accurate_cast_uint16_or_default<TValue>(TValue?)
accurateCastOrDefault(value, 'UInt16'): the checked conversion that
returns the target zero instead of raising when the value is not exactly
representable or cannot be parsed. The vendor returns UInt16, which the shared row reader cannot materialize, so the result is widened exactly with toInt32 and surfaced as int (0..65535 is lossless). A null
input yields the zero. Requires a provider that supports it (ClickHouse).
public int? accurate_cast_uint16_or_default<TValue>(TValue? value)
Parameters
valueTValue
Returns
- int?
Type Parameters
TValue
accurate_cast_uint16_or_null<TValue>(TValue?)
accurateCastOrNull(value, 'UInt16'): the checked conversion that
returns NULL instead of raising when the value is not exactly representable
or cannot be parsed. The vendor returns UInt16, which the shared row reader cannot materialize, so the result is widened exactly with toInt32 and surfaced as int (0..65535 is lossless). A null input yields
null. Requires a provider that supports it (ClickHouse).
public int? accurate_cast_uint16_or_null<TValue>(TValue? value)
Parameters
valueTValue
Returns
- int?
Type Parameters
TValue
accurate_cast_uint16<TValue>(TValue?)
accurateCast(value, 'UInt16'): the checked conversion to UInt16.
Unlike the to* member it raises CANNOT_CONVERT_TYPE instead of
wrapping or truncating when the value is not exactly representable (300 to Int8,
12.7 to Int8, 12.34 to Float32), while an exact value such as 12.0 to Int8 is
accepted; an unparsable string still raises CANNOT_PARSE_TEXT. The vendor returns UInt16, which the shared row reader cannot materialize, so the result is widened exactly with toInt32 and surfaced as int (0..65535 is lossless). A null input yields null. Requires a provider
that supports it (ClickHouse).
public int? accurate_cast_uint16<TValue>(TValue? value)
Parameters
valueTValue
Returns
- int?
Type Parameters
TValue
accurate_cast_uint32_or_default<TValue>(TValue?)
accurateCastOrDefault(value, 'UInt32'): the checked conversion that
returns the target zero instead of raising when the value is not exactly
representable or cannot be parsed. A null
input yields the zero. Requires a provider that supports it (ClickHouse).
public uint? accurate_cast_uint32_or_default<TValue>(TValue? value)
Parameters
valueTValue
Returns
- uint?
Type Parameters
TValue
accurate_cast_uint32_or_null<TValue>(TValue?)
accurateCastOrNull(value, 'UInt32'): the checked conversion that
returns NULL instead of raising when the value is not exactly representable
or cannot be parsed. A null input yields
null. Requires a provider that supports it (ClickHouse).
public uint? accurate_cast_uint32_or_null<TValue>(TValue? value)
Parameters
valueTValue
Returns
- uint?
Type Parameters
TValue
accurate_cast_uint32<TValue>(TValue?)
accurateCast(value, 'UInt32'): the checked conversion to UInt32.
Unlike the to* member it raises CANNOT_CONVERT_TYPE instead of
wrapping or truncating when the value is not exactly representable (300 to Int8,
12.7 to Int8, 12.34 to Float32), while an exact value such as 12.0 to Int8 is
accepted; an unparsable string still raises CANNOT_PARSE_TEXT. A null input yields null. Requires a provider
that supports it (ClickHouse).
public uint? accurate_cast_uint32<TValue>(TValue? value)
Parameters
valueTValue
Returns
- uint?
Type Parameters
TValue
accurate_cast_uint64_or_default<TValue>(TValue?)
accurateCastOrDefault(value, 'UInt64'): the checked conversion that
returns the target zero instead of raising when the value is not exactly
representable or cannot be parsed. A null
input yields the zero. Requires a provider that supports it (ClickHouse).
public ulong? accurate_cast_uint64_or_default<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
accurate_cast_uint64_or_null<TValue>(TValue?)
accurateCastOrNull(value, 'UInt64'): the checked conversion that
returns NULL instead of raising when the value is not exactly representable
or cannot be parsed. A null input yields
null. Requires a provider that supports it (ClickHouse).
public ulong? accurate_cast_uint64_or_null<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
accurate_cast_uint64<TValue>(TValue?)
accurateCast(value, 'UInt64'): the checked conversion to UInt64.
Unlike the to* member it raises CANNOT_CONVERT_TYPE instead of
wrapping or truncating when the value is not exactly representable (300 to Int8,
12.7 to Int8, 12.34 to Float32), while an exact value such as 12.0 to Int8 is
accepted; an unparsable string still raises CANNOT_PARSE_TEXT. A null input yields null. Requires a provider
that supports it (ClickHouse).
public ulong? accurate_cast_uint64<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
accurate_cast_uint8_or_default<TValue>(TValue?)
accurateCastOrDefault(value, 'UInt8'): the checked conversion that
returns the target zero instead of raising when the value is not exactly
representable or cannot be parsed. A null
input yields the zero. Requires a provider that supports it (ClickHouse).
public byte? accurate_cast_uint8_or_default<TValue>(TValue? value)
Parameters
valueTValue
Returns
- byte?
Type Parameters
TValue
accurate_cast_uint8_or_null<TValue>(TValue?)
accurateCastOrNull(value, 'UInt8'): the checked conversion that
returns NULL instead of raising when the value is not exactly representable
or cannot be parsed. A null input yields
null. Requires a provider that supports it (ClickHouse).
public byte? accurate_cast_uint8_or_null<TValue>(TValue? value)
Parameters
valueTValue
Returns
- byte?
Type Parameters
TValue
accurate_cast_uint8<TValue>(TValue?)
accurateCast(value, 'UInt8'): the checked conversion to UInt8.
Unlike the to* member it raises CANNOT_CONVERT_TYPE instead of
wrapping or truncating when the value is not exactly representable (300 to Int8,
12.7 to Int8, 12.34 to Float32), while an exact value such as 12.0 to Int8 is
accepted; an unparsable string still raises CANNOT_PARSE_TEXT. A null input yields null. Requires a provider
that supports it (ClickHouse).
public byte? accurate_cast_uint8<TValue>(TValue? value)
Parameters
valueTValue
Returns
- byte?
Type Parameters
TValue
age(string, DateTime, DateTime)
age(unit, start, end): the number of whole unit intervals
between two dates, at nanosecond precision. unit is one of
year, quarter, month, week, day, hour,
minute, second (singular, plural and vendor aliases are accepted by the
server). The unit must be a constant expression (a literal or a bound parameter): the
server rejects a column in that position, and the error is surfaced. The result is signed: an end before
start is negative, never clamped. Requires a provider that supports it
(ClickHouse); every other provider and the in-memory provider reject the call.
public long age(string unit, DateTime start, DateTime end)
Parameters
Returns
age(string?, DateTime?, DateTime?)
The nullable form of age(string, DateTime, DateTime): a NULL argument yields NULL (Nullable(Int64)).
public long? age(string? unit, DateTime? start, DateTime? end)
Parameters
Returns
- long?
analysis_of_variance<TValue, TGroup>(TValue?, TGroup?)
analysisOfVariance(value, group): the one-way ANOVA test, surfaced as
Tuple(f_statistic, p_value). Groups are numbered from 0, at least two groups are
required, and the vendor requires the group argument to be a native unsigned integer (a
signed column is rejected with BAD_ARGUMENTS, pinned live). Requires
ClickHouseAggregates (ClickHouse).
public Tuple<double, double> analysis_of_variance<TValue, TGroup>(TValue? value, TGroup? group)
Parameters
valueTValuegroupTGroup
Returns
Type Parameters
TValueTGroup
any_heavy<T>(T?)
anyHeavy(value): a frequently occurring value selected by the heavy-hitters algorithm (non-deterministic). Requires ClickHouseAggregates (ClickHouse).
public T? any_heavy<T>(T? value)
Parameters
valueT
Returns
- T
Type Parameters
T
any_last<T>(T?)
anyLast(value): the value of an arbitrary last row. Requires a
provider that supports it (see SupportsAnyLastAggregate; ClickHouse).
The arbitrary-value aggregate without the last-row restriction is the cross-provider
any_agg<T>(T?).
public T? any_last<T>(T? value)
Parameters
valueT
Returns
- T
Type Parameters
T
approx_top_k<T>(long, T?)
approx_top_k(N)(value): the approximately most frequent values with their counts and
error bounds, surfaced as Tuple(item, count, error)[] with long counters.
Requires ClickHouseAggregates (ClickHouse).
public Tuple<T, long, long>[] approx_top_k<T>(long k, T? value)
Parameters
klongvalueT
Returns
Type Parameters
T
approx_top_sum<T, TWeight>(long, T?, TWeight?)
approx_top_sum(N)(value, weight): the values with the largest approximate weight sum, surfaced as Tuple(item, count, error)[]. Requires ClickHouseAggregates (ClickHouse).
public Tuple<T, long, long>[] approx_top_sum<T, TWeight>(long k, T? value, TWeight? weight)
Parameters
klongvalueTweightTWeight
Returns
Type Parameters
TTWeight
arg_max<TValue, TBy>(TValue?, TBy?)
argMax(value, by): the value of the row where by is the largest.
public TValue? arg_max<TValue, TBy>(TValue? value, TBy? by)
Parameters
valueTValuebyTBy
Returns
- TValue
Type Parameters
TValueTBy
arg_min<TValue, TBy>(TValue?, TBy?)
argMin(value, by): the value of the row where by
is the smallest. Requires a provider that supports it (see
SupportsArgMinMax; ClickHouse).
public TValue? arg_min<TValue, TBy>(TValue? value, TBy? by)
Parameters
valueTValuebyTBy
Returns
- TValue
Type Parameters
TValueTBy
array_all<T>(Expression<Func<T, bool>>, T[])
arrayAll(predicate, array): true when the lambda returns true for every element.
Requires a provider that supports the higher-order array functions (see
SupportsHigherOrderArrayFunctions; ClickHouse).
public bool array_all<T>(Expression<Func<T, bool>> predicate, T[] array)
Parameters
predicateExpression<Func<T, bool>>arrayT[]
Returns
Type Parameters
T
array_avg<T>(T[])
arrayAvg(array): the average of the elements as Float64; an empty array yields
0. A Nullable-element array is rejected by the server ("array aggregation
function cannot be performed on type Nullable(...)") because no nullable overload exists.
Requires a provider that supports array functions (ClickHouse).
public double array_avg<T>(T[] array)
Parameters
arrayT[]
Returns
Type Parameters
T
array_bottom_k<T>(T[], long)
arrayBottomK(array, k): up to k smallest elements, sorted in
ascending order, with NULL elements skipped. The native name arrived in ClickHouse 26.6 and
is absent on the pinned 25.8 server, so the arm renders the vendor definition
arraySlice(arraySort(arrayFilter(x -> isNotNull(x), array)), 1, k). Requires a
provider that supports array functions (ClickHouse).
public T[] array_bottom_k<T>(T[] array, long k)
Parameters
arrayT[]klong
Returns
- T[]
Type Parameters
T
array_compact<T>(T[])
arrayCompact(array): removes consecutive duplicates, NULLs included
([1, 1, NULL, NULL, 2] is [1, NULL, 2]); the order is preserved. Requires a
provider that supports array functions (ClickHouse).
public T[] array_compact<T>(T[] array)
Parameters
arrayT[]
Returns
- T[]
Type Parameters
T
array_concat<T>(params T[][])
arrayConcat(arrays...): concatenates the arrays into one. Returns an array, so it can
be projected directly or used as the operand of another array function. Requires a provider
that supports array functions (see SupportsArrayFunctions;
ClickHouse).
public T[] array_concat<T>(params T[][] arrays)
Parameters
arraysT[][]
Returns
- T[]
Type Parameters
T
array_count<T>(Expression<Func<T, bool>>, T[])
arrayCount(predicate, array): the number of elements for which the lambda returns
true. Requires a provider that supports the higher-order array functions (see
SupportsHigherOrderArrayFunctions; ClickHouse).
public long array_count<T>(Expression<Func<T, bool>> predicate, T[] array)
Parameters
predicateExpression<Func<T, bool>>arrayT[]
Returns
Type Parameters
T
array_cum_sum_non_negative<T>(T[])
arrayCumSumNonNegative(array): the running sums of the elements, with every negative
running sum replaced by zero ([1, -2, 3, -4, 5] becomes [1, 0, 3, 0, 5]). The
vendor widens the accumulation (Int32 input → Array(Int64),
UInt8 input → Array(UInt64)); the declared CLR result is long
and only integral element types except ulong are accepted — a floating-point,
decimal or unsigned-64-bit element type is refused at translation time rather than
truncated into the declared long. An empty array yields an empty array, and a
Nullable-element array is rejected by the server (no nullable overload). Requires a
provider that supports array functions (ClickHouse).
public long[] array_cum_sum_non_negative<T>(T[] array)
Parameters
arrayT[]
Returns
- long[]
Type Parameters
T
array_cum_sum<T>(T[])
arrayCumSum(array): the running sums of the elements. Returns an array, so it can be
projected directly or used as the operand of another array function.
public T[] array_cum_sum<T>(T[] array)
Parameters
arrayT[]
Returns
- T[]
Type Parameters
T
array_difference<T>(T[])
arrayDifference(array): the differences between adjacent elements, with a leading
0 ([1, 2, 3, 4] is [0, 1, 1, 1]). The vendor widens the subtraction
result (Int16 input → Array(Int32), Int32/Int64 input →
Array(Int64)); the arm casts to Array(Int64), so the CLR result is
long[] and only integral element types are accepted — a floating-point or decimal
element type is refused at translation time because its fractional differences cannot be
carried by the declared long[]. Requires a provider that supports array functions
(ClickHouse).
public long[] array_difference<T>(T[] array)
Parameters
arrayT[]
Returns
- long[]
Type Parameters
T
array_distinct<T>(T[])
arrayDistinct(array): the distinct elements. Returns an array, so it can be projected directly or used as the operand of another array function.
public T[] array_distinct<T>(T[] array)
Parameters
arrayT[]
Returns
- T[]
Type Parameters
T
array_element<T>(T[], long)
arrayElement(array, index): the element at the one-based index.
Arrays are one-based and a negative index counts from the end (-1 is the last
element); an index outside the bounds returns the element type's default instead of an
error, which is the vendor contract rather than a client-side substitution. A NULL element
is returned as NULL (Nullable(T)), and a nullable element array keeps its positions.
Requires a provider that supports array functions (see
SupportsArrayFunctions; ClickHouse).
public T array_element<T>(T[] array, long index)
Parameters
arrayT[]indexlong
Returns
- T
Type Parameters
T
array_enumerate_dense<T>(T[])
arrayEnumerateDense(array): for each element, the one-based number of the position at
which its value first appears ([10, 20, 10, 30] is [1, 2, 1, 3]). The server
returns Array(UInt32); the arm casts it to Array(Int64), so the CLR result is
long[]. Requires a provider that supports array functions (ClickHouse).
public long[] array_enumerate_dense<T>(T[] array)
Parameters
arrayT[]
Returns
- long[]
Type Parameters
T
array_enumerate<T>(T[])
arrayEnumerate(array): the one-based positions [1, 2, ..., length(array)].
Returns an array, so it can be projected directly or used as the operand of another array function.
public long[] array_enumerate<T>(T[] array)
Parameters
arrayT[]
Returns
- long[]
Type Parameters
T
array_except<T>(params T[][])
arrayExcept(arrays...): the elements of the first array that are not in the others.
The native name exists only from ClickHouse 25.9; the current provider has no server-version
awareness, so on the pinned 25.8 baseline the call is refused with
NotSupportedException at translation/preparation time and no SQL is emitted.
The signature is retained for API compatibility; it is not executable here.
public T[] array_except<T>(params T[][] arrays)
Parameters
arraysT[][]
Returns
- T[]
Type Parameters
T
array_exists<T>(Expression<Func<T, bool>>, T[])
arrayExists(predicate, array): true when the lambda returns true for at least one
element. Requires a provider that supports the higher-order array functions (see
SupportsHigherOrderArrayFunctions; ClickHouse).
public bool array_exists<T>(Expression<Func<T, bool>> predicate, T[] array)
Parameters
predicateExpression<Func<T, bool>>arrayT[]
Returns
Type Parameters
T
array_fill<T>(Expression<Func<T, bool>>, T[])
arrayFill(lambda, array): scans the array from the first element, replacing an
element with the previous current element when the predicate is false; the first
element is always preserved (arrayFill(x -> not isNull(x), [1, NULL, 2, NULL]) is
[1, 1, 2, 2]). The lambda has exactly one parameter. Requires a provider that
supports the higher-order array functions (ClickHouse).
public T[] array_fill<T>(Expression<Func<T, bool>> predicate, T[] array)
Parameters
predicateExpression<Func<T, bool>>arrayT[]
Returns
- T[]
Type Parameters
T
array_filter<T>(Expression<Func<T, bool>>, T[])
arrayFilter(predicate, array): the elements for which the lambda returns true.
Requires a provider that supports the higher-order array functions (see
SupportsHigherOrderArrayFunctions; ClickHouse).
public T[] array_filter<T>(Expression<Func<T, bool>> predicate, T[] array)
Parameters
predicateExpression<Func<T, bool>>arrayT[]
Returns
- T[]
Type Parameters
T
array_filter<TIn1, TIn2>(Expression<Func<TIn1, TIn2, bool>>, TIn1[], TIn2[])
arrayFilter(predicate, first, second): the elements of first for
which the two-parameter lambda returns true, with the second parameter bound to the matching
element of second. Both arrays must have the same length. The index-lambda
idiom is array_filter((x, i) => i % 2 = 0, array, array_enumerate(array)): the
source array comes first, so the result is a subset of the source and not of the index array.
The lambda has exactly one parameter per array argument. Requires a provider that supports the
higher-order array functions (ClickHouse).
public TIn1[] array_filter<TIn1, TIn2>(Expression<Func<TIn1, TIn2, bool>> predicate, TIn1[] first, TIn2[] second)
Parameters
predicateExpression<Func<TIn1, TIn2, bool>>firstTIn1[]secondTIn2[]
Returns
- TIn1[]
Type Parameters
TIn1TIn2
array_first_index<T>(Expression<Func<T, bool>>, T[])
arrayFirstIndex(predicate, array): the one-based index of the first element for
which the lambda returns true, or 0 when there is none. Requires a provider that
supports the higher-order array functions (see
SupportsHigherOrderArrayFunctions; ClickHouse).
public long array_first_index<T>(Expression<Func<T, bool>> predicate, T[] array)
Parameters
predicateExpression<Func<T, bool>>arrayT[]
Returns
Type Parameters
T
array_first<T>(Expression<Func<T, bool>>, T[])
arrayFirst(predicate, array): the first element for which the lambda returns true,
or the default value of T when there is none. Requires a provider
that supports the higher-order array functions (see
SupportsHigherOrderArrayFunctions; ClickHouse).
public T? array_first<T>(Expression<Func<T, bool>> predicate, T[] array)
Parameters
predicateExpression<Func<T, bool>>arrayT[]
Returns
- T
Type Parameters
T
array_flatten<T>(T[][])
arrayFlatten(array): flattens one level of nesting of an Array(Array(T)).
Returns an array, so it can be projected directly or nested. Requires a provider that
supports array functions (see SupportsArrayFunctions; ClickHouse).
public T[] array_flatten<T>(T[][] arrays)
Parameters
arraysT[][]
Returns
- T[]
Type Parameters
T
array_fold<T, TAccumulator>(Expression<Func<TAccumulator, T, TAccumulator>>, T[], TAccumulator)
arrayFold(lambda, array, accumulator): folds the array into the accumulator, calling
lambda(acc, element) for each element in order. The lambda must have exactly two
parameters and its result type must equal the accumulator type (the server rejects a
mismatch with TYPE_MISMATCH). The lambda may reference the enclosing query's columns
and captured parameters. Requires a provider that supports the higher-order array functions
(see SupportsHigherOrderArrayFunctions; ClickHouse).
public TAccumulator array_fold<T, TAccumulator>(Expression<Func<TAccumulator, T, TAccumulator>> function, T[] array, TAccumulator accumulator)
Parameters
functionExpression<Func<TAccumulator, T, TAccumulator>>arrayT[]accumulatorTAccumulator
Returns
- TAccumulator
Type Parameters
TTAccumulator
array_intersect<T>(params T[][])
arrayIntersect(arrays...): the elements common to all the arrays. Returns an array, so
it can be projected directly or nested. Requires a provider that supports array functions
(see SupportsArrayFunctions; ClickHouse).
public T[] array_intersect<T>(params T[][] arrays)
Parameters
arraysT[][]
Returns
- T[]
Type Parameters
T
array_jaccard_index<T>(T[], T[])
arrayJaccardIndex(array1, array2): the vendor's Jaccard index of the two arrays, as
Float64: the number of distinct common elements divided by
length(array1) + length(array2) - common. The classic set formula holds only for
unique elements — [1, 1, 2] against [1, 2, 3] is 0.5, while
[1, 2, 3, 2] against itself is 0.6 because the raw lengths still count the
duplicates. Two empty arrays are rejected by the server. Requires a provider that supports
array functions (ClickHouse).
public double array_jaccard_index<T>(T[] array1, T[] array2)
Parameters
array1T[]array2T[]
Returns
Type Parameters
T
array_join<T>(T[])
arrayJoin(array): expands the array into one row per element. Requires a provider that
supports it (see SupportsArrayJoin; ClickHouse). The expanded value
can be projected and filtered like a scalar column.
public T array_join<T>(T[] array)
Parameters
arrayT[]
Returns
- T
Type Parameters
T
array_last_index<T>(Expression<Func<T, bool>>, T[])
arrayLastIndex(predicate, array): the one-based index of the last element for which
the lambda returns true, or 0 when there is none. Requires a provider that supports
the higher-order array functions (see
SupportsHigherOrderArrayFunctions; ClickHouse).
public long array_last_index<T>(Expression<Func<T, bool>> predicate, T[] array)
Parameters
predicateExpression<Func<T, bool>>arrayT[]
Returns
Type Parameters
T
array_last<T>(Expression<Func<T, bool>>, T[])
arrayLast(predicate, array): the last element for which the lambda returns true, or
the default value of T when there is none. Requires a provider that
supports the higher-order array functions (see
SupportsHigherOrderArrayFunctions; ClickHouse).
public T? array_last<T>(Expression<Func<T, bool>> predicate, T[] array)
Parameters
predicateExpression<Func<T, bool>>arrayT[]
Returns
- T
Type Parameters
T
array_map<TIn, TOut>(Expression<Func<TIn, TOut>>, TIn[])
arrayMap(function, array): the array of the lambda results. Requires a provider that
translates the higher-order array functions (see
SupportsHigherOrderArrayFunctions; ClickHouse). The lambda body may
use its parameter in operators and function calls; member access on the parameter is not
supported.
public TOut[] array_map<TIn, TOut>(Expression<Func<TIn, TOut>> function, TIn[] array)
Parameters
functionExpression<Func<TIn, TOut>>arrayTIn[]
Returns
- TOut[]
Type Parameters
TInTOut
array_map<TIn1, TIn2, TOut>(Expression<Func<TIn1, TIn2, TOut>>, TIn1[], TIn2[])
arrayMap(function, first, second): the array of the lambda results, with the lambda
receiving one element from first and one from second.
Both arrays must have the same length (the server rejects a length mismatch). This is the
documented index-lambda idiom: pass an index array as the first operand —
array_map((i, x) => i + x, array_enumerate(array), array). The lambda has exactly
one parameter per array argument, and ClickHouse has no separate index parameter. Requires a
provider that supports the higher-order array functions (ClickHouse).
public TOut[] array_map<TIn1, TIn2, TOut>(Expression<Func<TIn1, TIn2, TOut>> function, TIn1[] first, TIn2[] second)
Parameters
functionExpression<Func<TIn1, TIn2, TOut>>firstTIn1[]secondTIn2[]
Returns
- TOut[]
Type Parameters
TIn1TIn2TOut
array_max<T>(T[])
arrayMax(array): the maximum element, in the element's own type (an empty array
yields the type's default). A Nullable-element array is rejected by the server.
Requires a provider that supports array functions (ClickHouse).
public T array_max<T>(T[] array)
Parameters
arrayT[]
Returns
- T
Type Parameters
T
array_min<T>(T[])
arrayMin(array): the minimum element, in the element's own type (an empty array
yields the type's default). A Nullable-element array is rejected by the server.
Requires a provider that supports array functions (ClickHouse).
public T array_min<T>(T[] array)
Parameters
arrayT[]
Returns
- T
Type Parameters
T
array_partial_sort<T>(T[], long)
arrayPartialSort(limit, array): the same-size array whose first
limit elements are sorted ascending; the remaining elements are in an
unspecified order and the function is non-deterministic. A limit larger
than the array sorts the whole array. Requires a provider that supports array functions
(ClickHouse).
public T[] array_partial_sort<T>(T[] array, long limit)
Parameters
arrayT[]limitlong
Returns
- T[]
Type Parameters
T
array_pop_back<T>(T[])
arrayPopBack(array): the array without its last element (an empty array stays
empty). Requires a provider that supports array functions (ClickHouse).
public T[] array_pop_back<T>(T[] array)
Parameters
arrayT[]
Returns
- T[]
Type Parameters
T
array_pop_front<T>(T[])
arrayPopFront(array): the array without its first element (an empty array stays
empty). Requires a provider that supports array functions (ClickHouse).
public T[] array_pop_front<T>(T[] array)
Parameters
arrayT[]
Returns
- T[]
Type Parameters
T
array_product<T>(T[])
arrayProduct(array): the product of the elements as Float64 (an empty array
yields 0). A Nullable-element array is rejected by the server. Requires a
provider that supports array functions (ClickHouse).
public double array_product<T>(T[] array)
Parameters
arrayT[]
Returns
Type Parameters
T
array_push_back<T>(T[], T)
arrayPushBack(array, element): the array with element appended.
Returns an array, so it can be projected directly or used as the operand of another array function.
public T[] array_push_back<T>(T[] array, T element)
Parameters
arrayT[]elementT
Returns
- T[]
Type Parameters
T
array_push_front<T>(T[], T)
arrayPushFront(array, element): the array with element prepended.
A NULL element is appended as NULL and widens the element type to Nullable(T); it
is never replaced by a default. Requires a provider that supports array functions
(ClickHouse).
public T[] array_push_front<T>(T[] array, T element)
Parameters
arrayT[]elementT
Returns
- T[]
Type Parameters
T
array_random_sample<T>(T[], long)
arrayRandomSample(array, samples): a random sample of at most
samples elements; a larger request returns every element in an
unspecified order and zero returns an empty array. The function is non-deterministic, so
only the sample size and membership are stable. Requires a provider that supports array
functions (ClickHouse).
public T[] array_random_sample<T>(T[] array, long samples)
Parameters
arrayT[]sampleslong
Returns
- T[]
Type Parameters
T
array_reduce_in_ranges<T>(string, (long Start, long End)[], T[])
arrayReduceInRanges(aggregate, ranges, array) — refused. As
array_reduce<T>(string, T[]), the aggregate is named by a runtime SQL string
('sum', 'uniqUpTo(6)'), so no typed aggregate contract can close it and the
string would reach the server as an opaque SQL fragment; the (start, end) pairs only
select the ranges and do not remove that contract. The call is rejected deterministically at
translation/preparation time, before any SQL is emitted, on every provider; use the typed
array functions over array_slice for the common aggregates.
public T array_reduce_in_ranges<T>(string aggregate, (long Start, long End)[] ranges, T[] array)
Parameters
Returns
- T
Type Parameters
T
array_reduce<T>(string, T[])
arrayReduce(aggregate, array) — refused. The aggregate is named by a runtime
SQL string ('sum', 'uniqUpTo(6)'), so there is no typed aggregate contract
that a signature could close: any string reaching the server is an opaque SQL fragment.
The call is rejected deterministically at translation/preparation time, before any SQL is
emitted, on every provider; use the typed array functions (array_sum<T>(T[]),
array_min<T>(T[]), array_max<T>(T[]),
array_avg<T>(T[]), array_product<T>(T[])) for the common
aggregates.
public T array_reduce<T>(string aggregate, T[] array)
Parameters
aggregatestringarrayT[]
Returns
- T
Type Parameters
T
array_remove<T>(T[], T)
arrayRemove(array, element): removes every element equal to
element, with NULLs treated as equal to NULL (unlike a plain
arrayFilter, whose NULL comparison would keep them). The native name arrived in
ClickHouse 25.11 and is absent on the pinned 25.8 server, so the arm renders the equivalent
arrayFilter(x -> not coalesce(x = element, isNull(x) AND isNull(element)), array).
Requires a provider that supports array functions (ClickHouse).
public T[] array_remove<T>(T[] array, T element)
Parameters
arrayT[]elementT
Returns
- T[]
Type Parameters
T
array_resize<T>(T[], long)
arrayResize(array, size): changes the length, truncating from the right or extending
with the element type's default. A negative size keeps the last
|size| elements (the vendor rule, not a client-side clamp) and zero yields an empty
array. Requires a provider that supports array functions (ClickHouse).
public T[] array_resize<T>(T[] array, long size)
Parameters
arrayT[]sizelong
Returns
- T[]
Type Parameters
T
array_resize<T>(T[], long, T)
arrayResize(array, size, extender): as array_resize<T>(T[], long) but
extension uses extender; a NULL extender fills with NULL (it widens the
element type to Nullable(T)) rather than the element default. Requires a provider
that supports array functions (ClickHouse).
public T[] array_resize<T>(T[] array, long size, T extender)
Parameters
arrayT[]sizelongextenderT
Returns
- T[]
Type Parameters
T
array_reverse_fill<T>(Expression<Func<T, bool>>, T[])
arrayReverseFill(lambda, array): as array_fill<T>(Expression<Func<T, bool>>, T[]) but scanned from the
last element, whose value is always preserved. Requires a provider that supports the
higher-order array functions (ClickHouse).
public T[] array_reverse_fill<T>(Expression<Func<T, bool>> predicate, T[] array)
Parameters
predicateExpression<Func<T, bool>>arrayT[]
Returns
- T[]
Type Parameters
T
array_reverse_sort<T>(T[])
arrayReverseSort(array): the elements in descending order; NULL elements sort last,
which is the vendor order (asserted rather than corrected). Requires a provider that
supports array functions (ClickHouse).
public T[] array_reverse_sort<T>(T[] array)
Parameters
arrayT[]
Returns
- T[]
Type Parameters
T
array_reverse_split<T>(Expression<Func<T, bool>>, T[])
arrayReverseSplit(lambda, array): the reverse split — a sub-array ends after
every element for which the predicate is true (arrayReverseSplit(x -> x > 1,
[1, 2, 3]) is [[1, 2], [3]]); a true at the last position adds no trailing empty
sub-array. Returns an Array(Array(T)), surfaced as T[][]. Requires a provider
that supports the higher-order array functions (ClickHouse).
public T[][] array_reverse_split<T>(Expression<Func<T, bool>> predicate, T[] array)
Parameters
predicateExpression<Func<T, bool>>arrayT[]
Returns
- T[][]
Type Parameters
T
array_reverse<T>(T[])
arrayReverse(array): the elements in reverse order. Returns an array, so it can be projected directly or used as the operand of another array function.
public T[] array_reverse<T>(T[] array)
Parameters
arrayT[]
Returns
- T[]
Type Parameters
T
array_rotate_left<T>(T[], long)
arrayRotateLeft(array, n): rotates the elements left by n
positions (a negative n rotates right; an n larger
than the length wraps). No elements are added or removed. Requires a provider that supports
array functions (ClickHouse).
public T[] array_rotate_left<T>(T[] array, long n)
Parameters
arrayT[]nlong
Returns
- T[]
Type Parameters
T
array_rotate_right<T>(T[], long)
arrayRotateRight(array, n): rotates the elements right by n
positions (a negative n rotates left). Requires a provider that supports
array functions (ClickHouse).
public T[] array_rotate_right<T>(T[] array, long n)
Parameters
arrayT[]nlong
Returns
- T[]
Type Parameters
T
array_shift_left<T>(T[], long)
arrayShiftLeft(array, n): shifts the elements left by n positions,
filling the vacated positions with the element type's default; a negative
n shifts right. Requires a provider that supports array functions
(ClickHouse).
public T[] array_shift_left<T>(T[] array, long n)
Parameters
arrayT[]nlong
Returns
- T[]
Type Parameters
T
array_shift_left<T>(T[], long, T)
arrayShiftLeft(array, n, default): as array_shift_left<T>(T[], long)
but the vacated positions are filled with default. On the pinned server a
NULL fill value makes the whole result NULL (the vendor returns Nullable(Nothing))
instead of filling with NULLs; the arm passes it through rather than substituting a default.
Requires a provider that supports array functions (ClickHouse).
public T[] array_shift_left<T>(T[] array, long n, T @default)
Parameters
arrayT[]nlongdefaultT
Returns
- T[]
Type Parameters
T
array_shift_right<T>(T[], long)
arrayShiftRight(array, n): shifts the elements right by n
positions, filling the vacated positions with the element type's default; a negative
n shifts left. Requires a provider that supports array functions
(ClickHouse).
public T[] array_shift_right<T>(T[] array, long n)
Parameters
arrayT[]nlong
Returns
- T[]
Type Parameters
T
array_shift_right<T>(T[], long, T)
arrayShiftRight(array, n, default): as
array_shift_right<T>(T[], long) but the vacated positions are filled with
default; a NULL fill value makes the whole result NULL on the pinned
server, as with array_shift_left<T>(T[], long, T). Requires a provider that
supports array functions (ClickHouse).
public T[] array_shift_right<T>(T[] array, long n, T @default)
Parameters
arrayT[]nlongdefaultT
Returns
- T[]
Type Parameters
T
array_shingles<T>(T[], long)
arrayShingles(array, length): the consecutive sub-arrays of
length elements ([[1, 2, 3], [2, 3, 4]] for
[1, 2, 3, 4] and 3). A length greater than the array is rejected by the
server. Returns an Array(Array(T)), surfaced as T[][]. Requires a provider
that supports array functions (ClickHouse).
public T[][] array_shingles<T>(T[] array, long length)
Parameters
arrayT[]lengthlong
Returns
- T[][]
Type Parameters
T
array_similarity<T>(T[], T[], double[], double[])
arraySimilarity(from, to, fromWeights, toWeights): the weighted Levenshtein
similarity between 0 and 1 as Float64. On the pinned 25.8 server the
four-argument form is the only one (the two-argument shortcut is rejected with a
number-of-arguments error). Requires a provider that supports array functions (ClickHouse).
public double array_similarity<T>(T[] from, T[] to, double[] fromWeights, double[] toWeights)
Parameters
Returns
Type Parameters
T
array_slice<T>(T[], long)
arraySlice(array, offset): the elements from the one-based offset
to the end (a negative offset counts from the end). Returns an array, so it can be projected
directly or used as the operand of another array function.
public T[] array_slice<T>(T[] array, long offset)
Parameters
arrayT[]offsetlong
Returns
- T[]
Type Parameters
T
array_slice<T>(T[], long, long)
arraySlice(array, offset, length): as array_slice<T>(T[], long) but limited to length elements.
public T[] array_slice<T>(T[] array, long offset, long length)
Parameters
Returns
- T[]
Type Parameters
T
array_sort<T>(T[])
arraySort(array): the elements in ascending order. Returns an array, so it can be projected directly or used as the operand of another array function.
public T[] array_sort<T>(T[] array)
Parameters
arrayT[]
Returns
- T[]
Type Parameters
T
array_split<T>(Expression<Func<T, bool>>, T[])
arraySplit(lambda, array): splits the array so that a new sub-array starts at
every element for which the predicate is true (arraySplit(x -> x > 1, [1, 2, 3])
is [[1], [2], [3]]); the element belongs to the new sub-array. An
Array(Array(T)) is surfaced as a jagged T[][]. Requires a provider that
supports the higher-order array functions (ClickHouse).
public T[][] array_split<T>(Expression<Func<T, bool>> predicate, T[] array)
Parameters
predicateExpression<Func<T, bool>>arrayT[]
Returns
- T[][]
Type Parameters
T
array_string_concat<T>(T[], string?)
arrayStringConcat(array, delimiter): joins the elements into one string (default separator is the empty string).
public string array_string_concat<T>(T[] array, string? delimiter = null)
Parameters
arrayT[]delimiterstring
Returns
Type Parameters
T
array_sum<T>(T[])
arraySum(array): the sum of the elements. The vendor widens the result
(Int32 input → Int64, Float32 → Float64,
Decimal → Decimal(38, s)); the declared CLR result is long and
only integral element types except ulong are accepted — a floating-point,
decimal or unsigned-64-bit element type is refused at translation time rather than
truncated into the declared long. An empty array yields 0, and a
Nullable-element array is rejected by the server. Requires a provider that supports
array functions (ClickHouse).
public long array_sum<T>(T[] array)
Parameters
arrayT[]
Returns
Type Parameters
T
array_symmetric_difference<T>(params T[][])
arraySymmetricDifference(arrays...): the elements that occur in an odd number of the arrays. Returns an array, so it can be projected directly or nested.
public T[] array_symmetric_difference<T>(params T[][] arrays)
Parameters
arraysT[][]
Returns
- T[]
Type Parameters
T
array_top_k<T>(T[], long)
arrayTopK(array, k): up to k largest elements, sorted in
descending order, with NULL elements skipped. The native name arrived in ClickHouse 26.6
and is absent on the pinned 25.8 server, so the arm renders the vendor definition
arraySlice(arrayReverseSort(arrayFilter(x -> isNotNull(x), array)), 1, k), which
has the same sorted-non-null contract and is independent of the server version. Requires a
provider that supports array functions (ClickHouse).
public T[] array_top_k<T>(T[] array, long k)
Parameters
arrayT[]klong
Returns
- T[]
Type Parameters
T
array_transpose<T>(T[][])
arrayTranspose(array): the transpose of a two-dimensional array, where
result[i][j] equals array[j][i]; every inner array must have the same length.
The native name arrived in ClickHouse 26.4 and is absent on the pinned 25.8 server, so the
arm renders the definition arrayMap(i -> arrayMap(row -> row[i], array), range(1,
length(array[1]) + 1)), which is the transposition itself and is
version-independent. Requires a provider that supports array functions (ClickHouse).
public T[][] array_transpose<T>(T[][] array)
Parameters
arrayT[][]
Returns
- T[][]
Type Parameters
T
array_union<T>(params T[][])
arrayUnion(arrays...): the union of the arrays. Returns an array, so it can be projected directly or nested.
public T[] array_union<T>(params T[][] arrays)
Parameters
arraysT[][]
Returns
- T[]
Type Parameters
T
array_uniq<T>(T[])
arrayUniq(array): the number of distinct elements. Requires a provider that supports
array functions (see SupportsArrayFunctions; ClickHouse).
public long array_uniq<T>(T[] array)
Parameters
arrayT[]
Returns
Type Parameters
T
array_with_constant<T>(long, T)
arrayWithConstant(length, value): an array of length copies of
value. A NULL value produces an array of NULLs
(Array(Nullable(T))) rather than a default. Requires a provider that supports array
functions (ClickHouse).
public T[] array_with_constant<T>(long length, T value)
Parameters
lengthlongvalueT
Returns
- T[]
Type Parameters
T
array_zip<T1, T2>(T1[], T2[])
arrayZip(array1, array2): the pairwise tuples of two arrays of the same
length (the server rejects mismatched sizes rather than truncating). The result is an
Array(Tuple(T1, T2)), surfaced as Tuple<T1, T2>[]. Requires a provider
that supports array functions (ClickHouse).
public Tuple<T1, T2>[] array_zip<T1, T2>(T1[] array1, T2[] array2)
Parameters
array1T1[]array2T2[]
Returns
- Tuple<T1, T2>[]
Type Parameters
T1T2
base32_decode(string?)
base32Decode(value): decodes the RFC 4648 Base32 value (either
case is accepted). The decoded bytes are surfaced as an upper-case hexadecimal string, so
arbitrary binary round-trips without UTF-8 loss:
base32_decode(base32_encode(x)) is hex(x). An input whose length is not a
multiple of eight or that contains a character outside the Base32 alphabet raises the
server's INCORRECT_DATA error. An empty input yields the empty string and a
null input yields null. Requires a provider that
supports it (ClickHouse).
public string? base32_decode(string? value)
Parameters
valuestring
Returns
base32_encode(string?)
base32Encode(value): the RFC 4648 Base32 text of the UTF-8 bytes of
value, upper-case and '='-padded to a multiple of eight
characters. An empty input yields the empty string; a null input yields
null. Requires a provider that supports it (ClickHouse).
public string? base32_encode(string? value)
Parameters
valuestring
Returns
base58_decode(string?)
base58Decode(value): decodes the Bitcoin Base58 value and
surfaces the bytes as an upper-case hexadecimal string (a leading '1' is a zero
byte, so base58Decode('11') is '0000'). A character outside the alphabet
raises the server's INCORRECT_DATA error. An empty input yields the empty string
and a null input yields null. Requires a provider that
supports it (ClickHouse).
public string? base58_decode(string? value)
Parameters
valuestring
Returns
base58_encode(string?)
base58Encode(value): the Bitcoin Base58 text of the UTF-8 bytes of
value (the alphabet excludes 0, O, I and l,
and no padding is emitted). An empty input yields the empty string; a
null input yields null. Requires a provider that
supports it (ClickHouse).
public string? base58_encode(string? value)
Parameters
valuestring
Returns
base64_decode(string?)
base64Decode(value): the bytes encoded by the Base64 value, surfaced
as a string and therefore meaningful for UTF-8 text rather than for arbitrary binary (use the
hex/unhex pair to round-trip binary data). Malformed Base64 is rejected by the
server; an empty input yields the empty string and a null input yields
null. Requires a provider that supports it (ClickHouse).
public string? base64_decode(string? value)
Parameters
valuestring
Returns
base64_encode(string?)
base64Encode(value): the standard Base64 text of the UTF-8 bytes of
value; an empty input yields the empty string. A null
input yields null. Requires a provider that supports it (ClickHouse).
public string? base64_encode(string? value)
Parameters
valuestring
Returns
base64_url_decode(string?)
base64URLDecode(value): decodes the URL-safe Base64 value; both
the padded and the unpadded form are accepted and both alphabets are read. The decoded bytes
are surfaced as an upper-case hexadecimal string. An invalid alphabet raises the server's
INCORRECT_DATA error. An empty input yields the empty string and a
null input yields null. Requires a provider that
supports it (ClickHouse).
public string? base64_url_decode(string? value)
Parameters
valuestring
Returns
base64_url_encode(string?)
base64URLEncode(value): the URL-safe Base64 text of the UTF-8 bytes of
value ('-'/'_' alphabet, no '=' padding). An empty
input yields the empty string; a null input yields null.
Requires a provider that supports it (ClickHouse).
public string? base64_url_encode(string? value)
Parameters
valuestring
Returns
bech32_decode(string)
bech32Decode(address): the (hrp, data) pair of a Bech32 address, with the
binary data surfaced as an upper-case hexadecimal string. The server does not validate the
checksum: an address it cannot decode yields ('', '') rather than raising, so the
empty pair is the tested malformed-input outcome. A null address is
rejected by the server (a tuple cannot be inside Nullable), hence the non-nullable
parameter. Requires a provider that supports it (ClickHouse).
public Tuple<string, string> bech32_decode(string address)
Parameters
addressstring
Returns
bech32_encode(string?, string?, int?)
bech32Encode(hrp, data[, witver]): a Bech32/Bech32m address. hrp
is the 1–83-character lower-case human-readable part (usually 'bc' or 'tb')
and data is binary data — pass text for its UTF-8 bytes or
unhex(...) for arbitrary bytes. witver is optional:
0 selects Bech32 and 1 (the server default) or greater selects Bech32m. The
vendor returns an empty string when the input cannot form a valid address, and a
null argument yields null. Requires a provider that
supports it (ClickHouse).
public string? bech32_encode(string? hrp, string? data, int? witver = null)
Parameters
Returns
bin(ulong?)
bin(value): the binary representation of the unsigned 64-bit
value, most significant bit first and leading zero digits preserved
only to the value's minimal byte width: the vendor emits one character per bit of the
value's significant bytes (at least eight characters), so 42 is
'00101010' and MaxValue is 64 ones. A
null input yields null. Requires a provider that
supports it (ClickHouse).
public string? bin(ulong? value)
Parameters
valueulong?
Returns
bit_and(ulong?, ulong?)
bitAnd(left, right): the bitwise AND of two unsigned integers, surfaced as
ulong. The vendor keeps the first argument's width (UInt8/16/32/64); this
surface fixes the result at UInt64 and widens every unsigned input exactly with
toUInt64, which is lossless and cannot change a bitwise AND (the operands are
zero-extended). A null operand yields null.
Requires a provider that supports it (ClickHouse).
public ulong? bit_and(ulong? left, ulong? right)
Parameters
Returns
bit_count(ulong?)
bitCount(value): the number of set bits (popcount) of an unsigned integer. The
vendor returns UInt8 (0..64), surfaced as byte; the input is widened
exactly to UInt64, which cannot change the popcount. A
null input yields null. Requires a provider that
supports it (ClickHouse).
public byte? bit_count(ulong? value)
Parameters
valueulong?
Returns
- byte?
bit_hamming_distance(ulong?, ulong?)
bitHammingDistance(left, right) over two unsigned integers: the number of differing
bits, surfaced as byte (the vendor returns UInt8, 0..64). The
operands are widened exactly to UInt64; zero extension cannot change the distance.
A null operand yields null. Requires a provider that
supports it (ClickHouse).
public byte? bit_hamming_distance(ulong? left, ulong? right)
Parameters
Returns
- byte?
bit_hamming_distance(string?, string?)
bitHammingDistance(left, right) over two strings: the number of differing bits
over the UTF-8 bytes, the shorter input zero-padded. The vendor returns UInt64 for
the string overload (unlike the UInt8 integer overload), surfaced as
ulong. A null operand yields null.
Requires a provider that supports it (ClickHouse).
public ulong? bit_hamming_distance(string? left, string? right)
Parameters
Returns
bit_not(byte?)
bitNot(value) over a UInt8: the one's complement within the 8-bit width,
byte. The width is part of the function's semantics, so each width has its
own overload. A null input yields null. Requires a
provider that supports it (ClickHouse).
public byte? bit_not(byte? value)
Parameters
valuebyte?
Returns
- byte?
bit_not(ushort?)
bitNot(value) over a UInt16. The vendor returns UInt16, which the
shared row reader cannot materialize; the result is widened exactly with toInt32
(0..65535 is lossless) and surfaced as int. A
null input yields null. Requires a provider that
supports it (ClickHouse).
public int? bit_not(ushort? value)
Parameters
valueushort?
Returns
- int?
bit_not(uint?)
bitNot(value) over a UInt32: the one's complement within the 32-bit width,
uint. A null input yields null.
Requires a provider that supports it (ClickHouse).
public uint? bit_not(uint? value)
Parameters
valueuint?
Returns
- uint?
bit_not(ulong?)
bitNot(value) over a UInt64: the one's complement within the 64-bit width,
ulong. A null input yields null.
Requires a provider that supports it (ClickHouse).
public ulong? bit_not(ulong? value)
Parameters
valueulong?
Returns
bit_or(ulong?, ulong?)
bitOr(left, right): the bitwise OR of two unsigned integers, surfaced as
ulong. As bit_and(ulong?, ulong?), the inputs are widened
exactly to UInt64; zero extension cannot change a bitwise OR. A
null operand yields null. Requires a provider that
supports it (ClickHouse).
public ulong? bit_or(ulong? left, ulong? right)
Parameters
Returns
bit_positions_to_array(ulong)
bitPositionsToArray(value): the ascending zero-based positions of the set bits of
value (for example [1, 3] for 10); 0 yields an empty array.
The server rejects a Nullable argument, hence the non-nullable parameter. Requires a
provider that supports it (ClickHouse).
public ulong[] bit_positions_to_array(ulong value)
Parameters
valueulong
Returns
- ulong[]
bit_rotate_left(byte?, byte)
bitRotateLeft(value, shift) over a UInt8, byte. The rotation
is modulo the 8-bit width, so counts 0, 8 and 255 are equivalent. A
null value yields null. Requires a provider that
supports it (ClickHouse).
public byte? bit_rotate_left(byte? value, byte shift)
Parameters
Returns
- byte?
bit_rotate_left(ushort?, byte)
bitRotateLeft(value, shift) over a UInt16, widened exactly to
int. The rotation is modulo the 16-bit width. A
null value yields null. Requires a provider that
supports it (ClickHouse).
public int? bit_rotate_left(ushort? value, byte shift)
Parameters
Returns
- int?
bit_rotate_left(uint?, byte)
bitRotateLeft(value, shift) over a UInt32, uint. The
rotation is modulo the 32-bit width. A null value yields
null. Requires a provider that supports it (ClickHouse).
public uint? bit_rotate_left(uint? value, byte shift)
Parameters
Returns
- uint?
bit_rotate_left(ulong?, byte)
bitRotateLeft(value, shift) over a UInt64, ulong. The
rotation is modulo the 64-bit width. A null value yields
null. Requires a provider that supports it (ClickHouse).
public ulong? bit_rotate_left(ulong? value, byte shift)
Parameters
Returns
bit_rotate_right(byte?, byte)
bitRotateRight(value, shift) over a UInt8, byte. The rotation
is modulo the 8-bit width. A null value yields null.
Requires a provider that supports it (ClickHouse).
public byte? bit_rotate_right(byte? value, byte shift)
Parameters
Returns
- byte?
bit_rotate_right(ushort?, byte)
bitRotateRight(value, shift) over a UInt16, widened exactly to
int. The rotation is modulo the 16-bit width. A
null value yields null. Requires a provider that
supports it (ClickHouse).
public int? bit_rotate_right(ushort? value, byte shift)
Parameters
Returns
- int?
bit_rotate_right(uint?, byte)
bitRotateRight(value, shift) over a UInt32, uint. The
rotation is modulo the 32-bit width. A null value yields
null. Requires a provider that supports it (ClickHouse).
public uint? bit_rotate_right(uint? value, byte shift)
Parameters
Returns
- uint?
bit_rotate_right(ulong?, byte)
bitRotateRight(value, shift) over a UInt64, ulong. The
rotation is modulo the 64-bit width. A null value yields
null. Requires a provider that supports it (ClickHouse).
public ulong? bit_rotate_right(ulong? value, byte shift)
Parameters
Returns
bit_shift_left(byte?, byte)
bitShiftLeft(value, shift) over a UInt8, byte. The shift count
is the vendor's UInt8; on 25.8.33.6 a count of 0..7 shifts normally, a count equal
to the width returns 0 and any larger count returns 0 as well. A
null value yields null. Requires a provider that
supports it (ClickHouse).
public byte? bit_shift_left(byte? value, byte shift)
Parameters
Returns
- byte?
bit_shift_left(ushort?, byte)
bitShiftLeft(value, shift) over a UInt16, widened exactly to
int with toInt32. The shift-count semantics follow the vendor
(0..15 shift, a count of 16 or more yields 0). A null value yields
null. Requires a provider that supports it (ClickHouse).
public int? bit_shift_left(ushort? value, byte shift)
Parameters
Returns
- int?
bit_shift_left(uint?, byte)
bitShiftLeft(value, shift) over a UInt32, uint. The vendor
returns 0 for a count of 33 or more; on the pinned 25.8.33.6 server a count equal to 32
returns the value unchanged (a vendor quirk, pinned by the live tests). A
null value yields null. Requires a provider that
supports it (ClickHouse).
public uint? bit_shift_left(uint? value, byte shift)
Parameters
Returns
- uint?
bit_shift_left(ulong?, byte)
bitShiftLeft(value, shift) over a UInt64, ulong. The vendor
returns 0 for a count of 65 or more; on the pinned 25.8.33.6 server a count equal to 64
returns the value unchanged (a vendor quirk, pinned by the live tests). A
null value yields null. Requires a provider that
supports it (ClickHouse).
public ulong? bit_shift_left(ulong? value, byte shift)
Parameters
Returns
bit_shift_right(byte?, byte)
bitShiftRight(value, shift) over a UInt8, byte. Counts
0..7 shift normally; a count of 8 or more yields 0. A null value
yields null. Requires a provider that supports it (ClickHouse).
public byte? bit_shift_right(byte? value, byte shift)
Parameters
Returns
- byte?
bit_shift_right(ushort?, byte)
bitShiftRight(value, shift) over a UInt16, widened exactly to
int. Counts 0..15 shift normally; a count of 16 or more yields 0. A
null value yields null. Requires a provider that
supports it (ClickHouse).
public int? bit_shift_right(ushort? value, byte shift)
Parameters
Returns
- int?
bit_shift_right(uint?, byte)
bitShiftRight(value, shift) over a UInt32, uint. On the
pinned 25.8.33.6 server a count equal to 32 returns the value unchanged and 33 or more
yields 0 (a vendor quirk). A null value yields null.
Requires a provider that supports it (ClickHouse).
public uint? bit_shift_right(uint? value, byte shift)
Parameters
Returns
- uint?
bit_shift_right(ulong?, byte)
bitShiftRight(value, shift) over a UInt64, ulong. On the
pinned 25.8.33.6 server a count equal to 64 returns the value unchanged and 65 or more
yields 0 (a vendor quirk). A null value yields null.
Requires a provider that supports it (ClickHouse).
public ulong? bit_shift_right(ulong? value, byte shift)
Parameters
Returns
bit_test(byte?, byte)
bitTest(value, bitPosition) over a UInt8: whether the zero-based bit is
set, surfaced as bool (the vendor returns UInt8 0/1). A position
outside 0..7 is rejected by the server (PARAMETER_OUT_OF_BOUND), never silently
read as zero. A null value yields null. Requires a
provider that supports it (ClickHouse).
public bool? bit_test(byte? value, byte bitPosition)
Parameters
Returns
- bool?
bit_test(ushort?, byte)
bitTest(value, bitPosition) over a UInt16: whether the zero-based bit is
set, surfaced as bool. A position outside 0..15 is rejected by the server.
A null value yields null. Requires a provider that
supports it (ClickHouse).
public bool? bit_test(ushort? value, byte bitPosition)
Parameters
Returns
- bool?
bit_test(uint?, byte)
bitTest(value, bitPosition) over a UInt32: whether the zero-based bit is
set, surfaced as bool. A position outside 0..31 is rejected by the server.
A null value yields null. Requires a provider that
supports it (ClickHouse).
public bool? bit_test(uint? value, byte bitPosition)
Parameters
Returns
- bool?
bit_test(ulong?, byte)
bitTest(value, bitPosition) over a UInt64: whether the zero-based bit is
set, surfaced as bool. A position outside 0..63 is rejected by the server.
A null value yields null. Requires a provider that
supports it (ClickHouse).
public bool? bit_test(ulong? value, byte bitPosition)
Parameters
Returns
- bool?
bit_test_all(byte?, params byte[])
bitTestAll(value, bit1, bit2, ...) over a UInt8: whether every named bit is
set, surfaced as bool. The vendor requires the value plus at least one bit
position; an empty position list is rejected by the translator. A
null value yields null. Requires a provider that
supports it (ClickHouse).
public bool? bit_test_all(byte? value, params byte[] bitPositions)
Parameters
Returns
- bool?
bit_test_all(ushort?, params byte[])
bitTestAll(value, bit1, bit2, ...) over a UInt16: whether every named bit
is set, surfaced as bool. Requires at least one bit position. A
null value yields null. Requires a provider that
supports it (ClickHouse).
public bool? bit_test_all(ushort? value, params byte[] bitPositions)
Parameters
Returns
- bool?
bit_test_all(uint?, params byte[])
bitTestAll(value, bit1, bit2, ...) over a UInt32: whether every named bit
is set, surfaced as bool. Requires at least one bit position. A
null value yields null. Requires a provider that
supports it (ClickHouse).
public bool? bit_test_all(uint? value, params byte[] bitPositions)
Parameters
Returns
- bool?
bit_test_all(ulong?, params byte[])
bitTestAll(value, bit1, bit2, ...) over a UInt64: whether every named bit
is set, surfaced as bool. Requires at least one bit position. A
null value yields null. Requires a provider that
supports it (ClickHouse).
public bool? bit_test_all(ulong? value, params byte[] bitPositions)
Parameters
Returns
- bool?
bit_test_any(byte?, params byte[])
bitTestAny(value, bit1, bit2, ...) over a UInt8: whether any named bit is
set, surfaced as bool. The vendor requires the value plus at least one bit
position; an empty position list is rejected by the translator. A
null value yields null. Requires a provider that
supports it (ClickHouse).
public bool? bit_test_any(byte? value, params byte[] bitPositions)
Parameters
Returns
- bool?
bit_test_any(ushort?, params byte[])
bitTestAny(value, bit1, bit2, ...) over a UInt16: whether any named bit is
set, surfaced as bool. Requires at least one bit position. A
null value yields null. Requires a provider that
supports it (ClickHouse).
public bool? bit_test_any(ushort? value, params byte[] bitPositions)
Parameters
Returns
- bool?
bit_test_any(uint?, params byte[])
bitTestAny(value, bit1, bit2, ...) over a UInt32: whether any named bit is
set, surfaced as bool. Requires at least one bit position. A
null value yields null. Requires a provider that
supports it (ClickHouse).
public bool? bit_test_any(uint? value, params byte[] bitPositions)
Parameters
Returns
- bool?
bit_test_any(ulong?, params byte[])
bitTestAny(value, bit1, bit2, ...) over a UInt64: whether any named bit is
set, surfaced as bool. Requires at least one bit position. A
null value yields null. Requires a provider that
supports it (ClickHouse).
public bool? bit_test_any(ulong? value, params byte[] bitPositions)
Parameters
Returns
- bool?
bit_xor(ulong?, ulong?)
bitXor(left, right): the bitwise XOR of two unsigned integers, surfaced as
ulong. As bit_and(ulong?, ulong?), the inputs are widened
exactly to UInt64; zero extension cannot change a bitwise XOR. A
null operand yields null. Requires a provider that
supports it (ClickHouse).
public ulong? bit_xor(ulong? left, ulong? right)
Parameters
Returns
bitmask_to_array(ulong)
bitmaskToArray(value): the ascending powers of two that sum to
value, as Array(UInt64); 0 yields an empty array. The
argument is rendered through toUInt64, because the vendor result element type
follows the input width (Array(UInt8) for a small literal) and the declared CLR
shape is the unsigned 64-bit array. The server rejects a Nullable argument because
an array cannot be inside Nullable, hence the non-nullable parameter. Requires a
provider that supports it (ClickHouse).
public ulong[] bitmask_to_array(ulong value)
Parameters
valueulong
Returns
- ulong[]
bitmask_to_list(ulong?)
bitmaskToList(value): the same powers of two as a comma-separated string
(for example '2,8'); 0 yields the empty string. A null
input yields null. Requires a provider that supports it (ClickHouse).
public string? bitmask_to_list(ulong? value)
Parameters
valueulong?
Returns
blake3(string?)
BLAKE3(value): the 32-byte BLAKE3 digest rendered as 64 lowercase hexadecimal
characters (lower(hex(BLAKE3(value)))). A null input yields
null.
public string? blake3(string? value)
Parameters
valuestring
Returns
byte_hamming_distance(string?, string?)
byteHammingDistance(left, right): the number of differing bytes; the shorter input is
zero-padded to the longer one. The server returns UInt64; it is surfaced as
long (toInt64). A null argument yields
null. Requires a provider that supports it (ClickHouse).
public long? byte_hamming_distance(string? left, string? right)
Parameters
Returns
- long?
cbrt(double)
cbrt(x): the cube root of x (Float64). Requires a provider that
supports it (ClickHouse); every other provider and the in-memory provider reject the call.
public double cbrt(double x)
Parameters
xdouble
Returns
cbrt(double?)
cbrt(x) over a nullable argument: the cube root, or null when
x is null (Nullable(Float64)). Requires a provider
that supports it (ClickHouse); every other provider and the in-memory provider reject the call.
public double? cbrt(double? x)
Parameters
xdouble?
Returns
city_hash64(string?)
cityHash64(value): the 64-bit CityHash as a signed integer.
public long city_hash64(string? value)
Parameters
valuestring
Returns
cluster_all_replicas<TRow>(string, string, string)
clusterAllReplicas(cluster, database, table) as a FROM source: like
cluster<TRow>(string, string, string) but queries every replica of every shard as
a separate connection.
public TvfEntityBuilder<TRow> cluster_all_replicas<TRow>(string cluster, string database, string table)
Parameters
Returns
- TvfEntityBuilder<TRow>
Type Parameters
TRow
cluster<TRow>(string, string, string)
cluster(cluster, database, table) as a FROM source: reads table from
one replica of each shard of the configured cluster. The row shape is
declared by the caller through TRow. Requires a provider that supports
table functions (see SupportsTableFunction(string); ClickHouse). Connection
settings and credentials come from the server's remote_servers configuration.
public TvfEntityBuilder<TRow> cluster<TRow>(string cluster, string database, string table)
Parameters
Returns
- TvfEntityBuilder<TRow>
Type Parameters
TRow
contingency<TX, TY>(TX?, TY?)
contingency(x, y): the contingency coefficient of two columns. Requires ClickHouseAggregates (ClickHouse); the result is Float64.
public double contingency<TX, TY>(TX? x, TY? y)
Parameters
xTXyTY
Returns
Type Parameters
TXTY
count_equal<T>(T[], T)
countEqual(array, element): the number of elements equal to
element (NULL counts as equal to NULL). The server returns
UInt64; the arm lowers it with toInt64, so the CLR result is
long. Requires a provider that supports array functions (ClickHouse).
public long count_equal<T>(T[] array, T element)
Parameters
arrayT[]elementT
Returns
Type Parameters
T
count_substrings(string?, string?, int?)
countSubstrings(value, substring) or countSubstrings(value, substring, start):
the number of non-overlapping occurrences of substring, optionally counted
from the 1-based position start. An empty
substring counts zero. The server returns UInt64; it is surfaced as
long (toInt64). A null argument yields
null. Requires a provider that supports it (ClickHouse).
public long? count_substrings(string? value, string? substring, int? start = null)
Parameters
Returns
- long?
cramers_v_bias_corrected<TX, TY>(TX?, TY?)
cramersVBiasCorrected(x, y): the bias-corrected Cramer's V. Requires ClickHouseAggregates (ClickHouse); the result is Float64.
public double cramers_v_bias_corrected<TX, TY>(TX? x, TY? y)
Parameters
xTXyTY
Returns
Type Parameters
TXTY
cramers_v<TX, TY>(TX?, TY?)
cramersV(x, y): Cramer's V association measure. Requires ClickHouseAggregates (ClickHouse); the result is Float64.
public double cramers_v<TX, TY>(TX? x, TY? y)
Parameters
xTXyTY
Returns
Type Parameters
TXTY
cut_fragment(string?)
cutFragment(url): the URL without the fragment (the # included); the query
string stays. A null input yields null. Requires a
provider that supports it (ClickHouse).
public string? cut_fragment(string? url)
Parameters
urlstring
Returns
cut_ipv6(string?, byte, byte)
cutIPv6(num, bytesToCutForIPv6, zeroBytesForIPv4): the binary 16-byte IPv6 value given
as 32 hexadecimal digits, truncated to the first
bytesToCutForIPv6 significant bytes (zeroed tails are omitted). The
position arguments are UInt8; zeroBytesForIPv4 applies when the
address is IPv4-mapped. A null value yields null. Requires
a provider that supports it (ClickHouse).
public string? cut_ipv6(string? value, byte bytesToCutForIPv6, byte zeroBytesForIPv4)
Parameters
Returns
cut_query_string(string?)
cutQueryString(url): the URL without the query string (the ? included); the
fragment stays. A null input yields null. Requires a
provider that supports it (ClickHouse).
public string? cut_query_string(string? url)
Parameters
urlstring
Returns
cut_query_string_and_fragment(string?)
cutQueryStringAndFragment(url): the URL without the query string and the fragment. A
null input yields null. Requires a provider that supports
it (ClickHouse).
public string? cut_query_string_and_fragment(string? url)
Parameters
urlstring
Returns
cut_to_first_significant_subdomain(string?)
cutToFirstSignificantSubdomain(url): the host truncated to the first significant
subdomain (https://www.example.co.uk/x yields example.co.uk); an input that
cannot be parsed, such as a bare top-level domain or a userinfo URL, yields an empty string. A
null input yields null. Requires a provider that supports
it (ClickHouse).
public string? cut_to_first_significant_subdomain(string? url)
Parameters
urlstring
Returns
cut_to_first_significant_subdomain_custom(string?, string?)
cutToFirstSignificantSubdomainCustom(url, tldList): the custom-list variant of
cut_to_first_significant_subdomain(string?); the list must be configured on the
server, otherwise the vendor raises TLD_LIST_NOT_FOUND. A null
argument yields null. Requires a provider that supports it (ClickHouse).
public string? cut_to_first_significant_subdomain_custom(string? url, string? tldList)
Parameters
Returns
cut_to_first_significant_subdomain_custom_with_www(string?, string?)
cutToFirstSignificantSubdomainCustomWithWWW(url, tldList): the custom-list variant that
keeps a leading www.; the list must be configured on the server, otherwise the vendor
raises TLD_LIST_NOT_FOUND. A null argument yields
null. Requires a provider that supports it (ClickHouse).
public string? cut_to_first_significant_subdomain_custom_with_www(string? url, string? tldList)
Parameters
Returns
cut_to_first_significant_subdomain_with_www(string?)
cutToFirstSignificantSubdomainWithWWW(url): the variant that keeps a leading
www.. The pinned 25.8 server returns the same value as
cut_to_first_significant_subdomain(string?) (the prefix is not retained), which
is the vendor behaviour this member exposes rather than a CLR-side rewrite. A
null input yields null. Requires a provider that supports
it (ClickHouse).
public string? cut_to_first_significant_subdomain_with_www(string? url)
Parameters
urlstring
Returns
cut_url_parameter(string?, string?)
cutURLParameter(url, name): the URL with the first name=value occurrence of
name removed; an unmatched name leaves the URL unchanged, a value-less flag
parameter (?name) is not removed, and names are compared without decoding (so
Client ID and Client%20ID differ). A null argument yields
null. Requires a provider that supports it (ClickHouse).
public string? cut_url_parameter(string? url, string? name)
Parameters
Returns
cut_www(string?)
cutWWW(url): the URL with a leading www. removed from the host when the value
has a scheme (https://www.example.com/x becomes https://example.com/x); a bare
www.example.com is returned unchanged by the vendor's parser. A
null input yields null. Requires a provider that supports
it (ClickHouse).
public string? cut_www(string? url)
Parameters
urlstring
Returns
date_name(string, DateTime)
dateName(unit, value): the textual component of a date. unit is
one of year, quarter, month (English month name), week,
dayofyear, day, weekday (English weekday name), hour,
minute, second; an unsupported unit is refused by the server. The unit must
be a constant expression (a literal or a bound parameter); a column in that position is
rejected by the server. Requires a provider that supports it (ClickHouse); every other
provider and the in-memory provider reject the call.
public string date_name(string unit, DateTime value)
Parameters
Returns
date_name(string?, DateTime?)
The nullable form of date_name(string, DateTime): NULL stays NULL (Nullable(String)).
public string? date_name(string? unit, DateTime? value)
Parameters
Returns
date_time64_to_snowflake_id(DateTime?)
dateTime64ToSnowflakeID(value): the Snowflake id of a DateTime, encoded
as dateTime64ToSnowflakeID(toDateTime64(value, 3)) because the server requires
DateTime64. The vendor format carries milliseconds, so sub-millisecond digits of the
CLR value are truncated by the function itself (123456 µs and 123 ms produce the identical
id). A null input yields null. Requires a provider that
supports it (ClickHouse).
public ulong? date_time64_to_snowflake_id(DateTime? value)
Parameters
valueDateTime?
Returns
date_time_to_snowflake_id(DateTime?)
dateTimeToSnowflakeID(value): the Snowflake id of a DateTime — the
millisecond timestamp shifted by 22 bits. The server accepts DateTime only (not
DateTime64); an instant before the epoch is clamped to zero. A
null input yields null. Requires a provider that
supports it (ClickHouse).
public ulong? date_time_to_snowflake_id(DateTime? value)
Parameters
valueDateTime?
Returns
date_time_to_uuid_v7(DateTime)
dateTimeToUUIDv7(value): a version-7 UUID whose timestamp component is the
millisecond timestamp of value. The server requires a non-nullable
DateTime (a DateTime64 or Nullable argument is rejected), hence the
non-nullable parameter; use uuid_v7_to_datetime(Guid?) for the inverse.
Requires a provider that supports it (ClickHouse).
public Guid date_time_to_uuid_v7(DateTime value)
Parameters
valueDateTime
Returns
decode_url_component(string?)
decodeURLComponent(value): decodes percent-encoded escapes; a + is left as a
literal plus (that is the form-encoding rule, not this function). A
null input yields null. Requires a provider that supports
it (ClickHouse).
public string? decode_url_component(string? value)
Parameters
valuestring
Returns
decode_url_form_component(string?)
decodeURLFormComponent(value): form (RFC 1866) decoding, where a + becomes a
space and percent escapes are decoded. A null input yields
null. Requires a provider that supports it (ClickHouse).
public string? decode_url_form_component(string? value)
Parameters
valuestring
Returns
delta_sum_timestamp<TValue, TTime>(TValue?, TTime?)
deltaSumTimestamp(value, time): the consecutive-row differences ordered by
time, ignoring negative differences. The native result is the unsigned
counterpart of the input type and is normalised back to the declared type. Requires a
provider that supports the ClickHouse aggregate catalogue (see
ClickHouseAggregates; ClickHouse).
public TValue? delta_sum_timestamp<TValue, TTime>(TValue? value, TTime? time)
Parameters
valueTValuetimeTTime
Returns
- TValue
Type Parameters
TValueTTime
delta_sum<T>(T?)
deltaSum(value): the sum of the arithmetic differences between consecutive rows; the
result keeps the input type. Requires a provider that supports the ClickHouse aggregate
catalogue (see ClickHouseAggregates; ClickHouse).
public T? delta_sum<T>(T? value)
Parameters
valueT
Returns
- T
Type Parameters
T
dict_get_all<TValue, TKey>(string?, string?, TKey?)
dictGetAll('dict', 'attribute', id): every attribute value matching id
in a REGEXP_TREE dictionary, as the declared TValue array. An
absent key yields an empty array, never a substituted default. Requires a provider that
supports dictionaries (see SupportsDictionaries; ClickHouse).
public TValue[] dict_get_all<TValue, TKey>(string? dict, string? attribute, TKey? id)
Parameters
Returns
- TValue[]
Type Parameters
TValueTKey
dict_get_all<TValue, TKey>(string?, string?, TKey?, ulong)
dictGetAll('dict', 'attribute', id, limit): as
dict_get_all<TValue, TKey>(string?, string?, TKey?) truncated to
limit values (the vendor gives child matches precedence when truncating).
public TValue[] dict_get_all<TValue, TKey>(string? dict, string? attribute, TKey? id, ulong limit)
Parameters
Returns
- TValue[]
Type Parameters
TValueTKey
dict_get_children<TKey>(string?, TKey?)
dictGetChildren('dict', key): the first-level children of id in a
hierarchical dictionary. Requires a provider that supports dictionaries (see
SupportsDictionaries; ClickHouse).
public ulong[] dict_get_children<TKey>(string? dict, TKey? id)
Parameters
dictstringidTKey
Returns
- ulong[]
Type Parameters
TKey
dict_get_descendants<TKey>(string?, TKey?)
dictGetDescendants('dict', key): every descendant of id in a
hierarchical dictionary, at any depth. Requires a provider that supports dictionaries (see
SupportsDictionaries; ClickHouse).
public ulong[] dict_get_descendants<TKey>(string? dict, TKey? id)
Parameters
dictstringidTKey
Returns
- ulong[]
Type Parameters
TKey
dict_get_descendants<TKey>(string?, TKey?, byte)
dictGetDescendants('dict', key, level): as
dict_get_descendants<TKey>(string?, TKey?) limited to level
recursive steps; 0 means all descendants to the end.
public ulong[] dict_get_descendants<TKey>(string? dict, TKey? id, byte level)
Parameters
Returns
- ulong[]
Type Parameters
TKey
dict_get_hierarchy<TKey>(string?, TKey?)
dictGetHierarchy('dict', key): the key and all its parents in a hierarchical dictionary,
from the key up to the root. Requires a provider that supports dictionaries (see
SupportsDictionaries; ClickHouse).
public ulong[] dict_get_hierarchy<TKey>(string? dict, TKey? id)
Parameters
dictstringidTKey
Returns
- ulong[]
Type Parameters
TKey
dict_get_keys<TKey, TValue>(string?, string?, TValue?)
dictGetKeys('dict', 'attribute', value) is refused: the reverse-lookup function was
introduced in ClickHouse 25.12 and is absent from the pinned 25.8.33.6 server (it fails with
UNKNOWN_FUNCTION), so no SQL that executes on the target server can be emitted.
public TKey[] dict_get_keys<TKey, TValue>(string? dict, string? attribute, TValue? value)
Parameters
Returns
- TKey[]
Type Parameters
TKeyTValue
dict_get_or_default<TValue, TKey>(string?, string?, TKey?, TValue?)
dictGetOrDefault('dict', 'attribute', id, default): as dict_get but falls back to defaultValue.
public TValue? dict_get_or_default<TValue, TKey>(string? dict, string? attribute, TKey? id, TValue? defaultValue)
Parameters
Returns
- TValue
Type Parameters
TValueTKey
dict_get_or_null<TValue, TKey>(string?, string?, TKey?)
dictGetOrNull('dict', 'attribute', id): as dict_get<TValue, TKey>(string?, string?, TKey?) but
returns NULL (a null TValue) for an absent key instead of the
attribute's configured default value. For a value-type attribute pass the nullable CLR type
(for example ulong?) as TValue, so an absent key materialises
as null rather than the value type's zero. Requires a provider that
supports dictionaries (see SupportsDictionaries; ClickHouse).
public TValue? dict_get_or_null<TValue, TKey>(string? dict, string? attribute, TKey? id)
Parameters
Returns
- TValue
Type Parameters
TValueTKey
dict_get_root<TKey>(string?, TKey?)
dictGetRoot('dict', key) is refused: the root accessor was introduced in ClickHouse
26.7 and is absent from the pinned 25.8.33.6 server (it fails with UNKNOWN_FUNCTION);
use dict_get_hierarchy<TKey>(string?, TKey?) and take its last element.
public ulong dict_get_root<TKey>(string? dict, TKey? id)
Parameters
dictstringidTKey
Returns
Type Parameters
TKey
dict_get<TValue, TKey>(string?, string?, TKey?)
dictGet('dict', 'attribute', id): the attribute value for id from the
dictionary. Requires a provider that supports dictionaries (see
SupportsDictionaries; ClickHouse). The value type is the dictionary
attribute type, specified by the caller.
public TValue? dict_get<TValue, TKey>(string? dict, string? attribute, TKey? id)
Parameters
Returns
- TValue
Type Parameters
TValueTKey
dict_has<TKey>(string?, TKey?)
dictHas('dict', id): true when the dictionary contains id.
public bool dict_has<TKey>(string? dict, TKey? id)
Parameters
dictstringidTKey
Returns
Type Parameters
TKey
dict_is_in<TKey>(string?, TKey?, TKey?)
dictIsIn('dict', child, ancestor): true when childId is
ancestorId or a descendant of it in a hierarchical dictionary. Requires a
provider that supports dictionaries (see SupportsDictionaries;
ClickHouse).
public bool dict_is_in<TKey>(string? dict, TKey? childId, TKey? ancestorId)
Parameters
dictstringchildIdTKeyancestorIdTKey
Returns
Type Parameters
TKey
domain(string?)
domain(url): the host name of a URL, with or without a scheme. The vendor uses its fast
non-RFC parser, so a URL carrying userinfo (https://user:pw@example.com), an IPv6
literal host or a trailing-dot host yields an empty string rather than the host; an
unparsable value also yields an empty string. A null input yields
null. Requires a provider that supports it (ClickHouse).
public string? domain(string? url)
Parameters
urlstring
Returns
domain_without_www(string?)
domainWithoutWWW(url): the host name with a leading www. removed (the non-RFC
parser rules of domain(string?) apply). A null input yields
null. Requires a provider that supports it (ClickHouse).
public string? domain_without_www(string? url)
Parameters
urlstring
Returns
dot_product(Tuple<double, double>, Tuple<double, double>)
dotProduct(first, second) for Double components: the result is
Float64 and is cast to double, so no integer truncation happens.
public double dot_product(Tuple<double, double> first, Tuple<double, double> second)
Parameters
Returns
dot_product(Tuple<float, float>, Tuple<float, float>)
dotProduct(first, second) for Single components: the server promotes the
Float32 product to Float64, which the declared double keeps exactly.
public double dot_product(Tuple<float, float> first, Tuple<float, float> second)
Parameters
Returns
dot_product<T1, T2>(Tuple<T1, T2>, Tuple<T1, T2>)
dotProduct(first, second): the sum of the element-wise products, as long for
integral components (the server computes Int64/UInt64 and the call is lowered with a cast
to Int64). Decimal components would lose precision in the declared long and are
refused at translation. A Tuple<T1, T2> of double or float
selects the overload below, which keeps a floating-point result.
public long dot_product<T1, T2>(Tuple<T1, T2> first, Tuple<T1, T2> second)
Parameters
Returns
Type Parameters
T1T2
edit_distance(string?, string?)
editDistance(left, right): the Levenshtein distance between the two strings measured
over their UTF-8 bytes, so a multi-byte character counts per byte ('ёж' versus
'еж' is 2). The server returns UInt64; it is surfaced as long
(toInt64). A null argument yields null. Requires a
provider that supports it (ClickHouse).
public long? edit_distance(string? left, string? right)
Parameters
Returns
- long?
encode_url_component(string?)
encodeURLComponent(value): percent-encodes every reserved character of
value (RFC 3986 component encoding; a space becomes %20). A
null input yields null. Requires a provider that supports
it (ClickHouse).
public string? encode_url_component(string? value)
Parameters
valuestring
Returns
encode_url_form_component(string?)
encodeURLFormComponent(value): form (RFC 1866) encoding, where a space becomes a
+ and the remaining reserved characters are percent-encoded. A
null input yields null. Requires a provider that supports
it (ClickHouse).
public string? encode_url_form_component(string? value)
Parameters
valuestring
Returns
ends_with<T>(T[], T[])
endsWith(array, suffix): true when array ends with the suffix elements, in order.
public bool ends_with<T>(T[] array, T[] suffix)
Parameters
arrayT[]suffixT[]
Returns
Type Parameters
T
entropy<T>(T?)
entropy(value): the Shannon entropy of the value distribution. Requires a provider
that supports the ClickHouse aggregate catalogue (see
ClickHouseAggregates; ClickHouse). The result is Float64.
public double entropy<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
erf(double)
erf(x): the Gauss error function of x (Float64). It is odd
(erf(-x) = -erf(x)), tends to ±1 at the infinities and is nan for
nan. Requires a provider that supports it (ClickHouse); every other provider and the
in-memory provider reject the call.
public double erf(double x)
Parameters
xdouble
Returns
erf(double?)
erf(x) over a nullable argument: the Gauss error function, or null
when x is null (Nullable(Float64)). Requires a
provider that supports it (ClickHouse); every other provider and the in-memory provider reject
the call.
public double? erf(double? x)
Parameters
xdouble?
Returns
erfc(double)
erfc(x): the complementary error function 1 - erf(x) of x
(Float64), which keeps its precision in the far tail where 1 - erf(x) would lose
it. erfc(inf) = 0, erfc(-inf) = 2 and erfc(nan) = nan. Requires a provider
that supports it (ClickHouse); every other provider and the in-memory provider reject the call.
public double erfc(double x)
Parameters
xdouble
Returns
erfc(double?)
erfc(x) over a nullable argument: the complementary error function, or
null when x is null
(Nullable(Float64)). Requires a provider that supports it (ClickHouse); every other
provider and the in-memory provider reject the call.
public double? erfc(double? x)
Parameters
xdouble?
Returns
exp10(double)
exp10(x): ten raised to the power x (Float64). Requires a
provider that supports it (ClickHouse); every other provider and the in-memory provider reject
the call.
public double exp10(double x)
Parameters
xdouble
Returns
exp10(double?)
exp10(x) over a nullable argument: ten raised to the power x, or
null when x is null
(Nullable(Float64)). Requires a provider that supports it (ClickHouse); every other
provider and the in-memory provider reject the call.
public double? exp10(double? x)
Parameters
xdouble?
Returns
exp2(double)
exp2(x): two raised to the power x (Float64). Requires a
provider that supports it (ClickHouse); every other provider and the in-memory provider reject
the call.
public double exp2(double x)
Parameters
xdouble
Returns
exp2(double?)
exp2(x) over a nullable argument: two raised to the power x, or
null when x is null
(Nullable(Float64)). Requires a provider that supports it (ClickHouse); every other
provider and the in-memory provider reject the call.
public double? exp2(double? x)
Parameters
xdouble?
Returns
exponential_moving_average<TValue, TTime>(long, TValue?, TTime?)
exponentialMovingAverage(...) — refused. The aggregate returns an opaque
AggregateFunction state (a binary serialization) with no typed CLR result; only the
-Merge combinator yields the moving average, and it requires an
AggregateFunction-typed column the provider cannot read.
public object? exponential_moving_average<TValue, TTime>(long halfLife, TValue? value, TTime? time)
Parameters
halfLifelongvalueTValuetimeTTime
Returns
Type Parameters
TValueTTime
exponential_time_decayed_avg<TValue>(long, TValue, DateTime)
exponentialTimeDecayedAvg(decay)(value, time): the exponentially smoothed weighted average at the last point in time, window-only (must be completed with Over(...)). Requires ClickHouseAggregates (ClickHouse).
public WindowFunction<double> exponential_time_decayed_avg<TValue>(long decay, TValue value, DateTime time) where TValue : struct
Parameters
Returns
Type Parameters
TValue
exponential_time_decayed_count(long, DateTime)
exponentialTimeDecayedCount(decay)(time): the cumulative exponential decay at the last point in time, window-only (must be completed with Over(...)). Requires ClickHouseAggregates (ClickHouse).
public WindowFunction<double> exponential_time_decayed_count(long decay, DateTime time)
Parameters
Returns
exponential_time_decayed_max<TValue>(long, TValue, DateTime)
exponentialTimeDecayedMax(decay)(value, time): the exponentially smoothed maximum at the last point in time, window-only (must be completed with Over(...)). Requires ClickHouseAggregates (ClickHouse).
public WindowFunction<double> exponential_time_decayed_max<TValue>(long decay, TValue value, DateTime time) where TValue : struct
Parameters
Returns
Type Parameters
TValue
exponential_time_decayed_sum<TValue>(long, TValue, DateTime)
exponentialTimeDecayedSum(decay)(value, time): the exponentially smoothed weighted
sum at the last point in time. The vendor accepts it only as a window function (a bare
aggregate call is rejected with BAD_ARGUMENTS, pinned live), so the member returns
WindowFunction<T> and must be completed with Over(...). Requires
ClickHouseAggregates (ClickHouse).
public WindowFunction<double> exponential_time_decayed_sum<TValue>(long decay, TValue value, DateTime time) where TValue : struct
Parameters
Returns
Type Parameters
TValue
extract(string?, string?)
extract(value, pattern): the first fragment of value captured by the
RE2 pattern, or the empty string. Requires a provider that supports it
(ClickHouse).
public string? extract(string? value, string? pattern)
Parameters
Returns
extract_all(string?, string?)
extractAll(value, pattern): every fragment of value captured by the
RE2 pattern. The native result is Array(String), surfaced as
string[] and projected directly or used as the operand of another array function.
Requires a provider that supports it (ClickHouse).
public string[] extract_all(string? value, string? pattern)
Parameters
Returns
- string[]
extract_groups(string?, string?)
extractGroups(value, pattern): the capture groups of the first RE2 match as
Array(String), surfaced as string[]; a pattern that does not match yields an empty
array. ClickHouse cannot materialise a Nullable(Array(String)) result
(Nested type Array(String) cannot be inside Nullable type, Code 43), so both arguments
must be non-nullable expressions: a nullable column or a null literal is
rejected by the server rather than silently treated as an empty array. An empty pattern is
rejected too. Requires a provider that supports it (ClickHouse).
public string[] extract_groups(string? value, string? pattern)
Parameters
Returns
- string[]
extract_key_value_pairs(string?)
extractKeyValuePairs(data): the key/value pairs parsed from free-form text with the
vendor defaults (key/value delimiter :, pair delimiters space, , and
;), surfaced as the projectable Tuple<T1, T2> array of
(String, String) pairs. Duplicate keys are preserved (the server Map keeps them);
a NULL input is refused at translation because a Map cannot be inside
Nullable. Requires a provider that supports the map surface.
public Tuple<string, string>[] extract_key_value_pairs(string? data)
Parameters
datastring
Returns
extract_key_value_pairs(string?, string, string)
extractKeyValuePairs(data, keyValueDelimiter, pairDelimiter): the explicit-delimiter
form. Both delimiters are compile-time or bound strings; the server requires the exact
characters it is given (the defaults are : and the set space/,/;).
A NULL input is refused at translation.
public Tuple<string, string>[] extract_key_value_pairs(string? data, string keyValueDelimiter, string pairDelimiter)
Parameters
Returns
extract_url_parameter(string?, string?)
extractURLParameter(url, name): the value of the first name parameter, or an
empty string when it is absent. The vendor requires the query part to start with ?
(a bare a=1&b=2 yields an empty string), returns the value undecoded, matches names
case-sensitively and treats ; as an ordinary value character. A
null argument yields null. Requires a provider that
supports it (ClickHouse).
public string? extract_url_parameter(string? url, string? name)
Parameters
Returns
extract_url_parameter_names(string)
extractURLParameterNames(url): the parameter names as Array(String), in order
and undecoded (a value-less parameter contributes its name). The argument cannot be
Nullable, hence the non-nullable parameter. Requires a provider that supports it
(ClickHouse).
public string[] extract_url_parameter_names(string url)
Parameters
urlstring
Returns
- string[]
farm_hash64(string?)
farmHash64(value): the 64-bit FarmHash as the server's unsigned UInt64
(ulong), so no value is reinterpreted as negative. A null
input yields null.
public ulong? farm_hash64(string? value)
Parameters
valuestring
Returns
file<TRow>(string, string, string)
file(path, format, structure) as a FROM source: reads a file under the server's
user_files_path in the given format and column layout; the row shape
is declared by the caller through TRow. Requires a provider that
supports table functions (see SupportsTableFunction(string); ClickHouse).
The path is resolved by the server and is not a client filesystem path.
public TvfEntityBuilder<TRow> file<TRow>(string path, string format, string structure)
Parameters
Returns
- TvfEntityBuilder<TRow>
Type Parameters
TRow
first_significant_subdomain(string?)
firstSignificantSubdomain(url): the first significant subdomain under the built-in
list (a second-level label for com/net/org/co, otherwise a
third-level label; https://news.clickhouse.com.tr/ yields clickhouse). A
null input yields null. Requires a provider that supports
it (ClickHouse).
public string? first_significant_subdomain(string? url)
Parameters
urlstring
Returns
first_significant_subdomain_custom(string?, string?)
firstSignificantSubdomainCustom(url, tldList): the first significant subdomain under a
custom top-level-domain list configured on the server (<top_level_domains_lists>).
The list name is an ordinary argument; on a server without that configuration the vendor
raises TLD_LIST_NOT_FOUND. A null argument yields
null. Requires a provider that supports it (ClickHouse).
public string? first_significant_subdomain_custom(string? url, string? tldList)
Parameters
Returns
first_value<T>(T?)
first_value(value): the first encountered value — the vendor alias of any.
This is the aggregate (non-window) form; the window form is the inherited
first_value<T>(T?) completed with Over(...). The member
deliberately hides the inherited window member so the aggregate result type is T?.
Requires a provider that supports the ClickHouse aggregate catalogue
(see ClickHouseAggregates; ClickHouse).
public T? first_value<T>(T? value)
Parameters
valueT
Returns
- T
Type Parameters
T
flatten_tuple<T1, T2, T3>(Tuple<T1, Tuple<T2, T3>>)
flattenTuple(tuple): the named nested tuple flattened depth-first, one level deep.
The server accepts named tuples only; a named tuple column is flattened directly, while an
inline tuple constructor is first cast to a synthetic named type built from the declared
components (Tuple(f1 T1, f2 Tuple(f3 T2, f4 T3))). A cast of a nested tuple
column to another named type corrupts the values on 25.8 (verified), so that path is
deliberately not used. The result is cast to the declared flat
Tuple<T1, T2, T3>. Requires a provider that supports the ClickHouse tuple
surface.
public Tuple<T1, T2, T3> flatten_tuple<T1, T2, T3>(Tuple<T1, Tuple<T2, T3>> tuple)
Parameters
Returns
- Tuple<T1, T2, T3>
Type Parameters
T1T2T3
flatten_tuple<T1, T2, T3, T4>(Tuple<T1, Tuple<T2, Tuple<T3, T4>>>)
flattenTuple(tuple): the named nested tuple flattened depth-first, one level deep.
The server accepts named tuples only; a named tuple column is flattened directly, while an
inline tuple constructor is first cast to a synthetic named type built from the declared
components (Tuple(f1 T1, f2 Tuple(f3 T2, f4 T3))). A cast of a nested tuple
column to another named type corrupts the values on 25.8 (verified), so that path is
deliberately not used. The result is cast to the declared flat
Tuple<T1, T2, T3>. Requires a provider that supports the ClickHouse tuple
surface.
public Tuple<T1, T2, T3, T4> flatten_tuple<T1, T2, T3, T4>(Tuple<T1, Tuple<T2, Tuple<T3, T4>>> tuple)
Parameters
Returns
- Tuple<T1, T2, T3, T4>
Type Parameters
T1T2T3T4
format_date_time(DateTime?, string?, string?)
formatDateTime(value, format) or formatDateTime(value, format, timezone):
formats value with a ClickHouse format string. Requires a provider that
supports it (ClickHouse).
public string? format_date_time(DateTime? value, string? format, string? timezone = null)
Parameters
Returns
fragment(string?)
fragment(url): the fragment identifier without the leading #; a later #
stays part of the fragment. A URL without a fragment yields an empty string. A
null input yields null. Requires a provider that supports
it (ClickHouse).
public string? fragment(string? url)
Parameters
urlstring
Returns
from_unix_timestamp(uint?)
The nullable form of from_unix_timestamp(uint): NULL stays NULL (Nullable(DateTime)).
public DateTime? from_unix_timestamp(uint? timestamp)
Parameters
timestampuint?
Returns
from_unix_timestamp(uint?, string?, string?)
The nullable form of the formatting fromUnixTimestamp: a NULL argument yields NULL (Nullable(String)).
public string? from_unix_timestamp(uint? timestamp, string? format, string? timeZone)
Parameters
Returns
from_unix_timestamp(uint)
fromUnixTimestamp(timestamp): the DateTime of a Unix epoch second. The
parameter is uint because the vendor domain is UInt32 (1970..2106),
so a negative epoch cannot be expressed and silently clamped to the epoch. Requires a
provider that supports it (ClickHouse); every other provider and the in-memory provider
reject the call.
public DateTime from_unix_timestamp(uint timestamp)
Parameters
timestampuint
Returns
from_unix_timestamp(uint, string)
fromUnixTimestamp(timestamp, format): the MySQL-compatibility formatting form,
which returns a string using MySQL DATE_FORMAT specifiers (for
example %i for minutes). The format is passed as an ordinary argument, never
inlined. Requires a provider that supports it (ClickHouse); every other provider and the
in-memory provider reject the call.
public string from_unix_timestamp(uint timestamp, string format)
Parameters
Returns
from_unix_timestamp(uint, string, string?)
fromUnixTimestamp(timestamp, format, timeZone): the formatting form evaluated in
timeZone. Requires a provider that supports it (ClickHouse); every
other provider and the in-memory provider reject the call.
public string from_unix_timestamp(uint timestamp, string format, string? timeZone = null)
Parameters
Returns
from_unix_timestamp64_micro(long)
fromUnixTimestamp64Micro(value): the DateTime64(6) of a Unix epoch in
microseconds. Requires a provider that supports it (ClickHouse); every other provider and
the in-memory provider reject the call.
public DateTime from_unix_timestamp64_micro(long value)
Parameters
valuelong
Returns
from_unix_timestamp64_micro(long?)
The nullable form of from_unix_timestamp64_micro(long): NULL stays NULL (Nullable(DateTime64(6))).
public DateTime? from_unix_timestamp64_micro(long? value)
Parameters
valuelong?
Returns
from_unix_timestamp64_milli(long)
fromUnixTimestamp64Milli(value): the DateTime64(3) of a Unix epoch in
milliseconds. The full Int64 domain (1900..2299) is accepted, negatives included, so
pre-epoch instants are produced rather than clamped. Requires a provider that supports it
(ClickHouse); every other provider and the in-memory provider reject the call.
public DateTime from_unix_timestamp64_milli(long value)
Parameters
valuelong
Returns
from_unix_timestamp64_milli(long?)
The nullable form of from_unix_timestamp64_milli(long): NULL stays NULL (Nullable(DateTime64(3))).
public DateTime? from_unix_timestamp64_milli(long? value)
Parameters
valuelong?
Returns
from_unix_timestamp64_nano(long)
fromUnixTimestamp64Nano(value) — refused. The function returns
DateTime64(9), whose nanosecond digits cannot be represented by
DateTime (tick resolution is 100 ns), so materializing it would silently
truncate the value. The refusal is deterministic and tested; use
from_unix_timestamp64_micro(long) and keep the submicrosecond remainder, or
read the column through ExecuteRaw.
public DateTime from_unix_timestamp64_nano(long value)
Parameters
valuelong
Returns
from_utc_timestamp(DateTime, string)
fromUTCTimestamp(value, timeZone) — refused. The vendor result carries no
zone in its type on the pinned server (toTypeName is DateTime and
timezoneOf is UTC), yet its wall clock is the input reinterpreted in the
requested zone, so its underlying instant is shifted by that zone's offset (03:04:05 UTC
becomes 06:04:05 for Europe/Moscow). A DateTime can hold that wall
clock but cannot carry the zone that gives it meaning, and reading it as a UTC instant
silently yields a different instant; the (wall clock, zone) pair is therefore not
representable and the member is refused with a deterministic, tested reason. Use
timezone_offset(DateTime) or timezone_of(DateTime) to inspect
zones.
public DateTime from_utc_timestamp(DateTime value, string timeZone)
Parameters
Returns
gcd(long, long)
gcd(a, b): the greatest common divisor of two integral values. The result is
non-negative regardless of the operand signs (gcd(-12, 18) = 6), the operands are widened
to Int64 (gcd(Int32, Int32) already returns Int64) and Int64
overflow for Int64.MinValue is a server error. A zero operand is not identity: the
server raises ILLEGAL_DIVISION (division by zero) for gcd(0, b) and
gcd(a, 0), and that error is surfaced rather than replaced with a default.
There is deliberately no nullable overload: the server adapts the function to
Nullable(Int64) by evaluating it over the underlying column, where a NULL is its zero
default, so a nullable column that contains a NULL hits the same division by zero instead of
producing NULL. A nullable operand must be filtered or coalesced by the caller; no silent
coalesce is emitted.
Requires a provider that supports it (ClickHouse); every other provider and the in-memory provider reject the call.
public long gcd(long a, long b)
Parameters
Returns
generate_random()
generateRandom(...) as a FROM source; select
SqlFunctions.IGenerateRandomRow. Yields an unbounded stream of random rows with
the fixed structure id UInt64, value Float64, name String, so apply a page/limit.
Requires a provider that supports table functions (see
SupportsTableFunction(string); ClickHouse). Use through
ctx.From(() => ...).
public TvfEntityBuilder<SqlFunctions.IGenerateRandomRow> generate_random()
Returns
generate_random(long)
generateRandom(structure, seed) as a FROM source: as
generate_random() but with a fixed seed so the generated
values are reproducible.
public TvfEntityBuilder<SqlFunctions.IGenerateRandomRow> generate_random(long seed)
Parameters
seedlong
Returns
generate_snowflake_id()
generateSnowflakeID(): a new unsigned 64-bit Snowflake identifier. The vendor takes
the current millisecond timestamp shifted by 22 bits, so two calls in the same query
differ. Requires a provider that supports it (ClickHouse).
public ulong generate_snowflake_id()
Returns
generate_ulid()
generateULID(): a new ULID (a lexicographically sortable 26-character identifier).
Requires a provider that supports it (ClickHouse).
public string? generate_ulid()
Returns
gini<T>(T?)
gini(value): the Gini coefficient of the sample. Introduced after the pinned
25.8.33.6 server, where the native name raises UNKNOWN_FUNCTION (pinned by the live
negative test); the arm renders the vendor name for servers that ship it. Requires a
provider that supports the ClickHouse aggregate catalogue (see
ClickHouseAggregates; ClickHouse). The result is Float64.
public double gini<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
global_in<T>(T, QueryCommand<T>)
column GLOBAL IN (subquery): like IN, but the right-hand result is sent to every
node of a distributed cluster. Requires a provider that supports it (see
SupportsGlobalPredicates; ClickHouse). Negate with C# ! for
GLOBAL NOT IN.
public bool global_in<T>(T column, QueryCommand<T> cmd)
Parameters
columnTcmdQueryCommand<T>
Returns
Type Parameters
T
global_in<T>(T, IEnumerable<T>)
column GLOBAL IN (values): the value-list form of global_in<T>(T, QueryCommand<T>).
public bool global_in<T>(T column, IEnumerable<T> values)
Parameters
columnTvaluesIEnumerable<T>
Returns
Type Parameters
T
global_in<T>(T, params T[])
column GLOBAL IN (values): the value-list form of global_in<T>(T, QueryCommand<T>).
public bool global_in<T>(T column, params T[] values)
Parameters
columnTvaluesT[]
Returns
Type Parameters
T
group_array_insert_at<T>(T?, uint)
groupArrayInsertAt(value, position): inserts value at the zero-based
position; empty positions are zero-filled (the vendor default). The position
must be an unsigned integer. Requires ClickHouseAggregates
(ClickHouse).
public T[] group_array_insert_at<T>(T? value, uint position)
Parameters
valueTpositionuint
Returns
- T[]
Type Parameters
T
group_array_insert_at<T>(T?, uint, T?, uint)
groupArrayInsertAt(default, size)(value, position): inserts value
at position into an array of size positions filled with
defaultValue. Requires ClickHouseAggregates
(ClickHouse).
public T[] group_array_insert_at<T>(T? defaultValue, uint size, T? value, uint position)
Parameters
Returns
- T[]
Type Parameters
T
group_array_intersect<T>(T[]?)
groupArrayIntersect(array): the intersection of the arrays in the group. Requires ClickHouseAggregates (ClickHouse).
public T[] group_array_intersect<T>(T[]? values)
Parameters
valuesT[]
Returns
- T[]
Type Parameters
T
group_array_last<T>(long, T?)
groupArrayLast(limit)(value): the last limit values. Requires ClickHouseAggregates (ClickHouse).
public T[] group_array_last<T>(long limit, T? value)
Parameters
limitlongvalueT
Returns
- T[]
Type Parameters
T
group_array_moving_avg<T>(T?)
groupArrayMovingAvg(value): the running average of the group, surfaced as double[] (native Array(Float64)). Requires ClickHouseAggregates (ClickHouse).
public double[] group_array_moving_avg<T>(T? value)
Parameters
valueT
Returns
- double[]
Type Parameters
T
group_array_moving_sum<T>(T?)
groupArrayMovingSum(value): the running sum of the group, surfaced as long[] (native Array(Int64)). Requires ClickHouseAggregates (ClickHouse).
public long[] group_array_moving_sum<T>(T? value)
Parameters
valueT
Returns
- long[]
Type Parameters
T
group_array_sample<T>(long, long, T?)
groupArraySample(size, seed)(value): the seeded random sample. Requires ClickHouseAggregates (ClickHouse).
public T[] group_array_sample<T>(long size, long seed, T? value)
Parameters
Returns
- T[]
Type Parameters
T
group_array_sample<T>(long, T?)
groupArraySample(size)(value): at most size randomly selected values. Requires ClickHouseAggregates (ClickHouse).
public T[] group_array_sample<T>(long size, T? value)
Parameters
sizelongvalueT
Returns
- T[]
Type Parameters
T
group_array_sorted<T>(long, T?)
groupArraySorted(limit)(value): the first limit values in ascending order. Requires ClickHouseAggregates (ClickHouse).
public T[] group_array_sorted<T>(long limit, T? value)
Parameters
limitlongvalueT
Returns
- T[]
Type Parameters
T
group_array<T>(T?)
groupArray(value): aggregates the values of a group into an array. The native result
is Array(T), surfaced as T[] and projected directly (or used as the operand of
an array function such as array_sort<T>(T[])). Requires a provider that
supports the array surface (see SupportsArrayFunctions; ClickHouse).
The element order is unspecified; sort or concatenate in SQL for a stable result.
public T[] group_array<T>(T? value)
Parameters
valueT
Returns
- T[]
Type Parameters
T
group_bitmap_and<T>(T?)
groupBitmapAnd(bitmap): the intersection of the group's bitmap states.
public ulong? group_bitmap_and<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
group_bitmap_or<T>(T?)
groupBitmapOr(bitmap): the union of the group's bitmap states.
public ulong? group_bitmap_or<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
group_bitmap_xor<T>(T?)
groupBitmapXor(bitmap): the symmetric difference of the group's bitmap states.
public ulong? group_bitmap_xor<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
group_bitmap<T>(T?)
groupBitmap(value): the bitmap of the distinct unsigned integer values of a group,
surfaced as the opaque UInt64 bitmap state. Combine with the bitmap functions to count
or merge. Requires a provider that supports it (ClickHouse).
public ulong? group_bitmap<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
group_concat<T>(string?, long, T?)
groupConcat(separator, max_elements)(value): the capped concatenation with an explicit separator. Requires ClickHouseAggregates (ClickHouse).
public string? group_concat<T>(string? separator, long maxElements, T? value)
Parameters
Returns
Type Parameters
T
group_concat<T>(string?, T?)
groupConcat(separator)(value): the concatenation with an explicit separator. Requires ClickHouseAggregates (ClickHouse).
public string? group_concat<T>(string? separator, T? value)
Parameters
separatorstringvalueT
Returns
Type Parameters
T
group_concat<T>(T?)
groupConcat(value): the concatenation of the group's string values. Requires ClickHouseAggregates (ClickHouse).
public string? group_concat<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
group_format(string?, params object?[])
groupFormat(format)(value, ...): every row of the group rendered through the named
output format (JSONEachRow, CSV, TabSeparated, ...). The format name is
a parameter and must be a constant. Introduced after the pinned 25.8.33.6 server, where the
native name raises UNKNOWN_FUNCTION (pinned by the live negative test). Requires
ClickHouseAggregates (ClickHouse).
public string? group_format(string? format, params object?[] values)
Parameters
Returns
group_uniq_array<T>(T?)
groupUniqArray(value): aggregates the distinct values of a group into an array. The
native result is Array(T), surfaced as T[] and projected directly. Requires a
provider that supports the array surface (see
SupportsArrayFunctions; ClickHouse). The element order is
unspecified.
public T[] group_uniq_array<T>(T? value)
Parameters
valueT
Returns
- T[]
Type Parameters
T
half_md5(string?)
halfMD5(value): the first 8 bytes of the MD5 digest as the server's unsigned
UInt64 (big-endian). A null input yields null.
public ulong? half_md5(string? value)
Parameters
valuestring
Returns
has_all<T>(T[], T[])
hasAll(array, other): true when every element of other is in array.
public bool has_all<T>(T[] array, T[] other)
Parameters
arrayT[]otherT[]
Returns
Type Parameters
T
has_any<T>(T[], T[])
hasAny(array, other): true when the arrays have at least one common element.
public bool has_any<T>(T[] array, T[] other)
Parameters
arrayT[]otherT[]
Returns
Type Parameters
T
has_substr<T>(T[], T[])
hasSubstr(array, other): true when the elements of other appear in
array contiguously and in the same order (an empty other
is always contained). Requires a provider that supports array functions (see
SupportsArrayFunctions; ClickHouse).
public bool has_substr<T>(T[] array, T[] other)
Parameters
arrayT[]otherT[]
Returns
Type Parameters
T
has<T>(T[], T)
has(array, element): true when element is in array.
public bool has<T>(T[] array, T element)
Parameters
arrayT[]elementT
Returns
Type Parameters
T
hex(string?)
hex(value): the upper-case hexadecimal rendering of the UTF-8 bytes of
value; an empty input yields the empty string. A null
input yields null. Requires a provider that supports it (ClickHouse).
public string? hex(string? value)
Parameters
valuestring
Returns
hilbert_decode(ulong)
hilbertDecode(code): the (x, y) coordinates of a two-dimensional Hilbert
code, rendered as the native hilbertDecode(2, code) whose Tuple(UInt64, UInt64)
result is the declared pair. The vendor result arity follows a runtime size argument, so
the fixed two-component shape is the one a CLR type can name; the one-dimensional form is
reachable through raw SQL. Requires a provider that supports it (ClickHouse).
public Tuple<ulong, ulong> hilbert_decode(ulong code)
Parameters
codeulong
Returns
hilbert_encode(ulong)
hilbertEncode(value): the Hilbert curve code of the single unsigned coordinate
(UInt64). Requires a provider that supports it (ClickHouse).
public ulong hilbert_encode(ulong value)
Parameters
valueulong
Returns
hilbert_encode(ulong, ulong)
hilbertEncode(x, y): the Hilbert curve code of the two unsigned coordinates
(UInt64). Requires a provider that supports it (ClickHouse).
public ulong hilbert_encode(ulong x, ulong y)
Parameters
Returns
histogram<T>(long, T?)
histogram(bins)(value): an adaptive histogram surfaced as
Tuple(lower, upper, height)[] with all components Float64. Requires
ClickHouseAggregates (ClickHouse).
public Tuple<double, double, double>[] histogram<T>(long bins, T? value)
Parameters
binslongvalueT
Returns
Type Parameters
T
hive_hash(string?)
hiveHash(value): JavaHash with the sign bit cleared, as the server's signed
Int32 (the vendor type; the value is non-negative). A null input
yields null.
public int? hive_hash(string? value)
Parameters
valuestring
Returns
- int?
host_name()
The host name of the server that answered the query (hostName()). Use tcp_port()
for the listening port. Requires a provider that supports it (see
SessionInfoFunctions; ClickHouse).
public string host_name()
Returns
hypot(double, double)
hypot(a, b): the length of the hypotenuse sqrt(a² + b²) computed without
intermediate overflow (Float64). An infinite operand yields inf; a nan
operand with a finite one yields nan. Requires a provider that supports it (ClickHouse);
every other provider and the in-memory provider reject the call.
public double hypot(double a, double b)
Parameters
Returns
hypot(double?, double?)
hypot(a, b) over nullable operands: the hypotenuse length, or null
when either operand is null (Nullable(Float64)). Requires a provider
that supports it (ClickHouse); every other provider and the in-memory provider reject the call.
public double? hypot(double? a, double? b)
Parameters
Returns
index_of<T>(T[], T)
indexOf(array, element): the one-based position of the first occurrence, or 0 when absent.
public long index_of<T>(T[] array, T element)
Parameters
arrayT[]elementT
Returns
Type Parameters
T
initcap(string?)
initcap(value): upper-cases the first letter of every word and lower-cases the remaining
ones. The case mapping is ASCII-only, so non-ASCII letters keep their original case. A
null input yields null. Requires a provider that supports
it (ClickHouse).
public string? initcap(string? value)
Parameters
valuestring
Returns
int_div(long, long)
intDiv(a, b): integer division of a by b truncated
toward zero (intDiv(-7, 2) = -3). The operands are widened to Int64, so the result
is an Int64. A zero divisor is a server-side ILLEGAL_DIVISION error, not
0 and not the inf of the floating-point divide. Distinct from the CLR
/ operator, which is the catalog's divide form and is floating-point division on
ClickHouse. Requires a provider that supports it (ClickHouse); every other provider and the
in-memory provider reject the call.
public long int_div(long a, long b)
Parameters
Returns
int_div(long?, long?)
intDiv(a, b) over nullable operands: the truncated integer quotient, or
null when either operand is null
(Nullable(Int64)). Requires a provider that supports it (ClickHouse); every other
provider and the in-memory provider reject the call.
public long? int_div(long? a, long? b)
Parameters
Returns
- long?
int_exp10(long)
intExp10(x): 10^x as the unsigned 64-bit integer UInt64. A negative
exponent yields 0, and an exponent above 19 saturates at UInt64.MaxValue
(intExp10(20) is 18446744073709551615). Requires a provider that supports it
(ClickHouse); every other provider and the in-memory provider reject the call.
public ulong int_exp10(long x)
Parameters
xlong
Returns
int_exp10(long?)
intExp10(x) over a nullable argument: 10^x as UInt64, or
null when x is null
(Nullable(UInt64)). Requires a provider that supports it (ClickHouse); every other
provider and the in-memory provider reject the call.
public ulong? int_exp10(long? x)
Parameters
xlong?
Returns
int_exp2(long)
intExp2(x): 2^x as the unsigned 64-bit integer UInt64. A negative exponent
yields 0, and an exponent above 63 saturates at UInt64.MaxValue (intExp2(64)
is 18446744073709551615). Requires a provider that supports it (ClickHouse); every other
provider and the in-memory provider reject the call.
public ulong int_exp2(long x)
Parameters
xlong
Returns
int_exp2(long?)
intExp2(x) over a nullable argument: 2^x as UInt64, or
null when x is null
(Nullable(UInt64)). Requires a provider that supports it (ClickHouse); every other
provider and the in-memory provider reject the call.
public ulong? int_exp2(long? x)
Parameters
xlong?
Returns
int_hash32(long?)
intHash32(value): the 32-bit integer hash as the server's unsigned UInt32
(uint), never reinterpreted as negative. A null input
yields null.
public uint? int_hash32(long? value)
Parameters
valuelong?
Returns
- uint?
int_hash64(long?)
intHash64(value): the 64-bit integer hash as the server's unsigned UInt64.
A null input yields null.
public ulong? int_hash64(long? value)
Parameters
valuelong?
Returns
ipv4_cidr_to_range(string, byte)
IPv4CIDRToRange(address, prefix): the first and last address of the IPv4 CIDR block as
Tuple(IPv4, IPv4) — a two-component Tuple<T1, T2> of canonical
dotted-quad strings. The prefix is UInt8; a prefix above 32 is accepted by the vendor
and clamped to 32 (a single address), and a negative prefix is rejected by type. The native
IPv4 argument cannot be Nullable (a Tuple cannot be inside a Nullable type),
hence the non-nullable parameter. Requires a provider that supports it (ClickHouse).
public Tuple<string, string> ipv4_cidr_to_range(string address, byte prefix)
Parameters
Returns
ipv4_num_to_string(uint?)
IPv4NumToString(num): the dotted-quad text of a UInt32 address
(16909060 becomes 1.2.3.4). A null input yields
null. Requires a provider that supports it (ClickHouse).
public string? ipv4_num_to_string(uint? value)
Parameters
valueuint?
Returns
ipv4_num_to_string_class_c(uint?)
IPv4NumToStringClassC(num): the class-C textual form, where the last octet is the
literal xxx (192.168.1.xxx). A null input yields
null. Requires a provider that supports it (ClickHouse).
public string? ipv4_num_to_string_class_c(uint? value)
Parameters
valueuint?
Returns
ipv4_string_to_num(string?)
IPv4StringToNum(value): the UInt32 of a dotted-quad address. A malformed value
(missing or out-of-range octet, leading zero, surrounding space, empty string) raises the
vendor's CANNOT_PARSE_IPV4 error; use
ipv4_string_to_num_or_null(string?) for a NULL result. A
null input yields null. Requires a provider that supports
it (ClickHouse).
public uint? ipv4_string_to_num(string? value)
Parameters
valuestring
Returns
- uint?
ipv4_string_to_num_or_default(string?)
IPv4StringToNumOrDefault(value): the UInt32 of a dotted-quad address, or
0 for a malformed value; unlike the OrNull sibling a NULL input still yields
NULL. Requires a provider that supports it (ClickHouse).
public uint? ipv4_string_to_num_or_default(string? value)
Parameters
valuestring
Returns
- uint?
ipv4_string_to_num_or_null(string?)
IPv4StringToNumOrNull(value): the UInt32 of a dotted-quad address, or
null for a malformed or null input instead of raising.
Requires a provider that supports it (ClickHouse).
public uint? ipv4_string_to_num_or_null(string? value)
Parameters
valuestring
Returns
- uint?
ipv4_to_ipv6(string?)
IPv4ToIPv6(address): the IPv4-mapped IPv6 form of a dotted-quad address
(1.2.3.4 becomes ::ffff:1.2.3.4), rendered as canonical text. A
null input yields null. Requires a provider that supports
it (ClickHouse).
public string? ipv4_to_ipv6(string? address)
Parameters
addressstring
Returns
ipv6_cidr_to_range(string, byte)
IPv6CIDRToRange(address, prefix): the first and last address of the IPv6 CIDR block as
Tuple(IPv6, IPv6) — a two-component Tuple<T1, T2> of canonical text. The
prefix is UInt8; a prefix above 128 is accepted by the vendor and clamped to 128 (a
single address). The argument cannot be Nullable, hence the non-nullable parameter.
Requires a provider that supports it (ClickHouse).
public Tuple<string, string> ipv6_cidr_to_range(string address, byte prefix)
Parameters
Returns
ipv6_num_to_string(string?)
IPv6NumToString(num): the compressed textual IPv6 form of the 16-byte binary value
given as 32 hexadecimal digits — the form ipv6_string_to_num(string?) returns,
so the pair round-trips. A shorter input is zero-padded by toFixedString, a longer one
is rejected by the server. A null input yields null.
Requires a provider that supports it (ClickHouse).
public string? ipv6_num_to_string(string? value)
Parameters
valuestring
Returns
ipv6_string_to_num(string?)
IPv6StringToNum(value): the 16-byte FixedString(16) binary address as 32
upper-case hexadecimal digits (the explicit hex convention shared with the binary UUID
forms, because the driver does not expose the raw bytes usefully). A malformed value raises
the vendor's CANNOT_PARSE_IPV6 error; use
ipv6_string_to_num_or_null(string?) for a NULL result. A
null input yields null. Requires a provider that supports
it (ClickHouse).
public string? ipv6_string_to_num(string? value)
Parameters
valuestring
Returns
ipv6_string_to_num_or_default(string?)
IPv6StringToNumOrDefault(value): the 16-byte binary address as 32 upper-case
hexadecimal digits, or thirty-two zeros for a malformed value; a NULL input still yields
NULL. Requires a provider that supports it (ClickHouse).
public string? ipv6_string_to_num_or_default(string? value)
Parameters
valuestring
Returns
ipv6_string_to_num_or_null(string?)
IPv6StringToNumOrNull(value): the 16-byte binary address as 32 upper-case hexadecimal
digits, or null for a malformed or null input instead of
raising. Requires a provider that supports it (ClickHouse).
public string? ipv6_string_to_num_or_null(string? value)
Parameters
valuestring
Returns
is_finite(double)
isFinite(x): true when x is neither infinite nor
nan. The server returns UInt8, surfaced as bool. A
null argument yields null, never false.
Requires a provider that supports it (ClickHouse); every other provider and the in-memory
provider reject the call.
public bool is_finite(double x)
Parameters
xdouble
Returns
is_finite(double?)
isFinite(x) over a nullable argument: true/false, or
null when x is null
(Nullable(UInt8)). Requires a provider that supports it (ClickHouse); every other
provider and the in-memory provider reject the call.
public bool? is_finite(double? x)
Parameters
xdouble?
Returns
- bool?
is_infinite(double)
isInfinite(x): true for ±inf only (nan is not infinite).
The server returns UInt8, surfaced as bool; a null
argument yields null. Requires a provider that supports it (ClickHouse);
every other provider and the in-memory provider reject the call.
public bool is_infinite(double x)
Parameters
xdouble
Returns
is_infinite(double?)
isInfinite(x) over a nullable argument: true/false, or
null when x is null
(Nullable(UInt8)). Requires a provider that supports it (ClickHouse); every other
provider and the in-memory provider reject the call.
public bool? is_infinite(double? x)
Parameters
xdouble?
Returns
- bool?
is_ip_address_in_range(string?, string)
isIPAddressInRange(address, prefix): true when the address lies in
the CIDR range named by prefix (1.2.3.0/24). The vendor returns
UInt8 and does NOT propagate NULL: a null address yields
false, which is why the result is non-nullable; a malformed address or
range raises CANNOT_PARSE_TEXT, and the prefix argument cannot be NULL. Requires a
provider that supports it (ClickHouse).
public bool is_ip_address_in_range(string? address, string prefix)
Parameters
Returns
is_ipv4_string(string?)
isIPv4String(value): true when the whole string is a dotted-quad IPv4
address. The server returns UInt8, surfaced as bool; the NULL of a
nullable argument stays null, never false. Requires a
provider that supports it (ClickHouse).
public bool? is_ipv4_string(string? value)
Parameters
valuestring
Returns
- bool?
is_ipv6_string(string?)
isIPv6String(value): true when the whole string is an IPv6 address
(including the IPv4-mapped form). The server returns UInt8, surfaced as
bool; a NULL input stays null, never
false. Requires a provider that supports it (ClickHouse).
public bool? is_ipv6_string(string? value)
Parameters
valuestring
Returns
- bool?
is_nan(double)
isNaN(x): true only for nan (inf is not nan). The
server returns UInt8, surfaced as bool; a null argument
yields null, never false. Requires a provider that supports
it (ClickHouse); every other provider and the in-memory provider reject the call.
public bool is_nan(double x)
Parameters
xdouble
Returns
is_nan(double?)
isNaN(x) over a nullable argument: true/false, or
null when x is null
(Nullable(UInt8)). Requires a provider that supports it (ClickHouse); every other
provider and the in-memory provider reject the call.
public bool? is_nan(double? x)
Parameters
xdouble?
Returns
- bool?
is_valid_json(string?)
isValidJSON(json): true for well-formed JSON and
false for malformed text (including the empty string); SQL NULL
yields NULL, never false. The native UInt8 result is
surfaced as Nullable(UInt8) → bool. Requires a provider that supports
the string-JSON family (see SupportsJsonExtract; ClickHouse).
public bool? is_valid_json(string? json)
Parameters
jsonstring
Returns
- bool?
jaro_similarity(string?, string?)
jaroSimilarity(left, right): the Jaro similarity of the two strings as Float64,
from 0 (no common characters) to 1 (equal strings; two empty strings are 0). A
null argument yields null. Requires a provider that
supports it (ClickHouse).
public double? jaro_similarity(string? left, string? right)
Parameters
Returns
java_hash(string?)
javaHash(value): the Java String.hashCode value as the server's signed
Int32 (it can be negative). A null input yields
null.
public int? java_hash(string? value)
Parameters
valuestring
Returns
- int?
json_all_paths(string?)
JSONAllPaths(json): the list of paths stored in the native ClickHouse JSON
value. The native result is Array(String), surfaced as string[] and projected
directly (or used as the operand of an array function such as
length<T>(T[])). json must be a native ClickHouse JSON
value; a String column needs CAST(col AS JSON) first. Requires a provider that
supports the JSON functions (see SupportsJsonExtract; ClickHouse).
public string[] json_all_paths(string? json)
Parameters
jsonstring
Returns
- string[]
json_all_paths_with_types(string?)
JSONAllPathsWithTypes(json): the paths stored in the native ClickHouse JSON
value together with their data types. The native result is Map(String, String),
surfaced as Dictionary<string, string> and projected directly; use ClickHouse
mapKeys/mapValues to turn it into a collection. json must be
a native ClickHouse JSON value; a String column needs CAST(col AS JSON)
first. Requires a provider that supports the JSON functions (see
SupportsJsonExtract; ClickHouse).
public Dictionary<string, string> json_all_paths_with_types(string? json)
Parameters
jsonstring
Returns
json_array_length(string?)
JSONArrayLength(json): the number of elements in the outermost JSON array, or
null when json is not a valid JSON array — an object,
a scalar, empty text, malformed JSON, or SQL NULL all yield NULL. The native
result is Nullable(UInt64), lowered to Nullable(Int64) so it maps to
long? — the null is preserved and is never replaced by 0. Requires a
provider that supports the string-JSON family (see
SupportsJsonExtract; ClickHouse).
public long? json_array_length(string? json)
Parameters
jsonstring
Returns
- long?
json_dynamic_paths(string?)
JSONDynamicPaths(json): the paths stored as separate subcolumns of a native
ClickHouse JSON value, as Array(String) surfaced as string[].
json must be a native JSON-typed expression: a JSON column
(whether mapped as a string or as a JSON DOM) is read directly, and a text value needs
CAST(text AS JSON). A plain String literal or parameter is rejected by the
server (NUMBER_OF_ARGUMENTS_DOESNT_MATCH), a Nullable(JSON) column is
rejected because Array(String) cannot be nested in Nullable
(ILLEGAL_TYPE_OF_ARGUMENT), and a SQL NULL JSON value yields NULL.
Requires a provider that supports the JSON functions (see
SupportsJsonExtract; ClickHouse).
public string[] json_dynamic_paths(string? json)
Parameters
jsonstring
Returns
- string[]
json_dynamic_paths_with_types(string?)
JSONDynamicPathsWithTypes(json): the dynamic paths of a native ClickHouse JSON
value together with their data types, as Map(String, String) surfaced as
Dictionary<TKey, TValue>. The argument rules are those of
json_dynamic_paths(string?); an empty map means the row stores no dynamic
path. Requires a provider that supports the JSON functions (see
SupportsJsonExtract; ClickHouse).
public Dictionary<string, string> json_dynamic_paths_with_types(string? json)
Parameters
jsonstring
Returns
json_exists(string?, string?)
JSON_EXISTS(json, path): true when the JSONPath path exists.
public bool json_exists(string? json, string? path)
Parameters
Returns
json_extract_array_raw(string?)
JSONExtractArrayRaw(json): the array elements, each as raw JSON text, surfaced as
string[] and projected directly. Requires a provider that supports the string-JSON
family (see SupportsJsonExtract; ClickHouse).
public string[] json_extract_array_raw(string? json)
Parameters
jsonstring
Returns
- string[]
json_extract_array_raw(string?, string?)
JSONExtractArrayRaw(json, path): as json_extract_array_raw(string?) at path.
public string[] json_extract_array_raw(string? json, string? path)
Parameters
Returns
- string[]
json_extract_bool(string?, string?)
JSONExtractBool(json, path): the boolean at path.
public bool json_extract_bool(string? json, string? path)
Parameters
Returns
json_extract_float(string?, string?)
JSONExtractFloat(json, path): the double at path.
public double json_extract_float(string? json, string? path)
Parameters
Returns
json_extract_int(string?, string?)
JSONExtractInt(json, path): the 64-bit integer at path.
public long json_extract_int(string? json, string? path)
Parameters
Returns
json_extract_keys(string?)
JSONExtractKeys(json): the object keys, surfaced as string[] and projected
directly (or used as the operand of another array function). Requires a provider that
supports the string-JSON family (see SupportsJsonExtract;
ClickHouse).
public string[] json_extract_keys(string? json)
Parameters
jsonstring
Returns
- string[]
json_extract_keys(string?, string?)
JSONExtractKeys(json, path): as json_extract_keys(string?) at path.
public string[] json_extract_keys(string? json, string? path)
Parameters
Returns
- string[]
json_extract_keys_and_values_raw(string?)
JSONExtractKeysAndValuesRaw(json): the object key/value pairs of the whole document,
with every value kept as unparsed JSON text, surfaced as
Tuple<string, string>[]. Malformed JSON or a non-object document yields an
empty array; SQL NULL yields NULL. Requires a provider that supports the
string-JSON family (see SupportsJsonExtract; ClickHouse).
public Tuple<string, string>[] json_extract_keys_and_values_raw(string? json)
Parameters
jsonstring
Returns
json_extract_keys_and_values_raw(string?, string?)
JSONExtractKeysAndValuesRaw(json, path): as
json_extract_keys_and_values_raw(string?) at path.
public Tuple<string, string>[] json_extract_keys_and_values_raw(string? json, string? path)
Parameters
Returns
json_extract_keys_and_values<T>(string?)
JSONExtractKeysAndValues(json, value_type): the object key/value pairs, surfaced as
Tuple<string, T>[] and projected directly. Requires a provider that supports the
string-JSON family (see SupportsJsonExtract; ClickHouse).
public Tuple<string, T>[] json_extract_keys_and_values<T>(string? json)
Parameters
jsonstring
Returns
Type Parameters
TThe ClickHouse value type, named in SQL through the dialect type map; it must be a non-nullable CLR type.
json_extract_keys_and_values<T>(string?, string?)
JSONExtractKeysAndValues(json, path, value_type): as json_extract_keys_and_values<T>(string?) at path.
public Tuple<string, T>[] json_extract_keys_and_values<T>(string? json, string? path)
Parameters
Returns
Type Parameters
TThe ClickHouse value type; it must be a non-nullable CLR type.
json_extract_raw(string?, string?)
JSONExtractRaw(json, path): the raw JSON fragment (object/array) at path.
public string? json_extract_raw(string? json, string? path)
Parameters
Returns
json_extract_string(string?, string?)
JSONExtractString(json, path): the string at path. JSON is stored in
a text column; requires a provider that supports it (see
SupportsJsonExtract; ClickHouse).
public string? json_extract_string(string? json, string? path)
Parameters
Returns
json_extract_uint(string?, string?)
JSONExtractUInt(json, path): the unsigned 64-bit integer at
path, or 0 when the path is missing, the value has another type,
or the document is malformed — the vendor default, asserted rather than replaced by the
library. SQL NULL yields NULL, never 0, so the result is
ulong?. Requires a provider that supports the string-JSON family (see
SupportsJsonExtract; ClickHouse).
public ulong? json_extract_uint(string? json, string? path)
Parameters
Returns
json_extract_uint_or_default(string?, string?, ulong)
JSONExtractUIntOrDefault(json, path, default) is refused: ClickHouse 25.8.33.6 has
no such function (it is absent from system.functions and the name fails with
UNKNOWN_FUNCTION), so no SQL that executes on the pinned server can be emitted.
json_extract_uint(string?, string?) already returns the vendor default
0 for a missing path, a wrong value type, or malformed JSON and NULL for a
SQL NULL; a default argument would invent a semantic the server does not define.
public ulong? json_extract_uint_or_default(string? json, string? path, ulong defaultValue)
Parameters
Returns
json_has(string?, string?)
JSONHas(json, path): true when path exists.
public bool json_has(string? json, string? path)
Parameters
Returns
json_key(string?)
JSONKey(json): the name of a key in a JSON object, or an empty string when the value
has no key. The argument may be a text JSON value or a native JSON value; SQL
NULL yields NULL. Requires a provider that supports the string-JSON family
(see SupportsJsonExtract; ClickHouse).
public string? json_key(string? json)
Parameters
jsonstring
Returns
json_key(string?, int)
JSONKey(json, index): the key name at the 1-based index; indices
outside the object/array yield an empty string, not a default key name. SQL NULL
yields NULL.
public string? json_key(string? json, int index)
Parameters
Returns
json_key(string?, string?)
JSONKey(json, key): the key name reached through the single object key
key, or an empty string when it does not exist. Use
json_key(string?, int) to address an array position or object member by its
1-based index.
public string? json_key(string? json, string? key)
Parameters
Returns
json_length(string?, string?)
JSONLength(json, path): the length of the array/object at path.
public long json_length(string? json, string? path)
Parameters
Returns
json_merge_patch(string?, string?)
JSONMergePatch(json1, json2): merges the RFC 7396 merge patch
json2 into json1 and returns the merged JSON object as
text (for example {"a":1} patched with {"a":2,"b":3} gives
{"a":2,"b":3}). Both arguments must be valid JSON object strings: a malformed
argument or a SQL NULL is a server error (BAD_ARGUMENTS), never an empty
document. Requires a provider that supports the string-JSON family (see
SupportsJsonExtract; ClickHouse).
public string json_merge_patch(string? json1, string? json2)
Parameters
Returns
json_merge_patch(string?, string?, string?)
JSONMergePatch(json1, json2, json3): merges three JSON objects left to right (the
vendor accepts one or more operands; the surface exposes the two- and three-operand forms).
A malformed or SQL NULL operand is a server error (BAD_ARGUMENTS).
public string json_merge_patch(string? json1, string? json2, string? json3)
Parameters
Returns
json_query(string?, string?)
JSON_QUERY(json, path): the JSON object/array at the JSONPath path as text.
public string? json_query(string? json, string? path)
Parameters
Returns
json_shared_data_paths(string?)
JSONSharedDataPaths(json): the paths stored in the shared data structure of a native
ClickHouse JSON value, as Array(String) surfaced as string[]. The
argument rules and refusals are those of json_dynamic_paths(string?). Requires
a provider that supports the JSON functions (see
SupportsJsonExtract; ClickHouse).
public string[] json_shared_data_paths(string? json)
Parameters
jsonstring
Returns
- string[]
json_shared_data_paths_with_types(string?)
JSONSharedDataPathsWithTypes(json): the shared-data paths of a native ClickHouse
JSON value together with their data types, as Map(String, String) surfaced as
Dictionary<TKey, TValue>. The argument rules and refusals are those of
json_dynamic_paths(string?). Requires a provider that supports the JSON
functions (see SupportsJsonExtract; ClickHouse).
public Dictionary<string, string> json_shared_data_paths_with_types(string? json)
Parameters
jsonstring
Returns
json_type(string?, string?)
JSONType(json, path): the type name of the value at path.
public string? json_type(string? json, string? path)
Parameters
Returns
json_value(string?, string?)
JSON_VALUE(json, path): the scalar value at the JSONPath path
(for example $.a[0]). Requires a provider that supports the string-JSON family (see
SupportsJsonExtract; ClickHouse).
public string? json_value(string? json, string? path)
Parameters
Returns
keccak256(string?)
keccak256(value): the 32-byte Keccak-256 digest rendered as 64 lowercase hexadecimal
characters (lower(hex(keccak256(value)))). A null input yields
null.
public string? keccak256(string? value)
Parameters
valuestring
Returns
kolmogorov_smirnov_test<TData, TIndex>(TData?, TIndex?)
kolmogorovSmirnovTest(sample_data, sample_index): the Kolmogorov-Smirnov test over the
two non-empty populations encoded by sampleIndex, surfaced as
Tuple(d_statistic, p_value). Requires ClickHouseAggregates
(ClickHouse).
public Tuple<double, double> kolmogorov_smirnov_test<TData, TIndex>(TData? sampleData, TIndex? sampleIndex)
Parameters
sampleDataTDatasampleIndexTIndex
Returns
Type Parameters
TDataTIndex
kurt_pop<T>(T?)
kurtPop(value): the population kurtosis. Requires ClickHouseAggregates (ClickHouse); the result is Float64.
public double kurt_pop<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
kurt_samp<T>(T?)
kurtSamp(value): the sample kurtosis. Requires ClickHouseAggregates (ClickHouse); the result is Float64.
public double kurt_samp<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
lag_in_frame<T>(T?)
lagInFrame(value[, offset[, default]]): like CommonFunctions.lag but evaluated
within the ordered window frame. Requires a provider that supports it (see
SupportsInFrameWindowFunctions; ClickHouse). The standard lag
looks at the whole partition and ignores the frame, so the two differ on a partial frame.
public WindowFunction<T?> lag_in_frame<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
lag_in_frame<T>(T?, int)
lagInFrame(value, offset): as lag_in_frame with an explicit offset.
public WindowFunction<T?> lag_in_frame<T>(T? value, int offset)
Parameters
valueToffsetint
Returns
Type Parameters
T
lag_in_frame<T>(T?, int, T?)
lagInFrame(value, offset, default): as lag_in_frame with a fallback value.
public WindowFunction<T?> lag_in_frame<T>(T? value, int offset, T? defaultValue)
Parameters
valueToffsetintdefaultValueT
Returns
Type Parameters
T
last_value<T>(T?)
last_value(value): the last encountered value, the NULL-accepting sibling of
anyLast. This is the aggregate (non-window) form; the window form is the inherited
last_value<T>(T?) completed with Over(...). The member
deliberately hides the inherited window member so the aggregate result type is T?.
Requires a provider that supports the ClickHouse aggregate catalogue
(see ClickHouseAggregates; ClickHouse).
public T? last_value<T>(T? value)
Parameters
valueT
Returns
- T
Type Parameters
T
lcm(long, long)
lcm(a, b): the least common multiple of two integral values, always non-negative
(lcm(-4, 6) = 12). Like gcd(long, long), a zero operand is a server-side
ILLEGAL_DIVISION error rather than 0, and no nullable overload is offered for the
same reason (a NULL in a nullable column reaches the zero-operand error). Requires a provider
that supports it (ClickHouse); every other provider and the in-memory provider reject the call.
public long lcm(long a, long b)
Parameters
Returns
lead_in_frame<T>(T?)
leadInFrame(value[, offset[, default]]): like CommonFunctions.lead but evaluated
within the ordered window frame. Requires a provider that supports it (see
SupportsInFrameWindowFunctions; ClickHouse). The standard lead
looks at the whole partition and ignores the frame, so the two differ on a partial frame.
public WindowFunction<T?> lead_in_frame<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
lead_in_frame<T>(T?, int)
leadInFrame(value, offset): as lead_in_frame with an explicit offset.
public WindowFunction<T?> lead_in_frame<T>(T? value, int offset)
Parameters
valueToffsetint
Returns
Type Parameters
T
lead_in_frame<T>(T?, int, T?)
leadInFrame(value, offset, default): as lead_in_frame with a fallback value.
public WindowFunction<T?> lead_in_frame<T>(T? value, int offset, T? defaultValue)
Parameters
valueToffsetintdefaultValueT
Returns
Type Parameters
T
length<T>(T[])
length(array): the number of elements. Requires a provider that supports array
functions (see SupportsArrayFunctions; ClickHouse).
public long length<T>(T[] array)
Parameters
arrayT[]
Returns
Type Parameters
T
lgamma(double)
lgamma(x): the natural logarithm of the absolute value of the gamma function of
x (Float64). lgamma(1) = 0; at a pole (0 or another
non-positive integer) the server returns inf and nan respectively, never an
exception. Requires a provider that supports it (ClickHouse); every other provider and the
in-memory provider reject the call.
public double lgamma(double x)
Parameters
xdouble
Returns
lgamma(double?)
lgamma(x) over a nullable argument: the log-gamma value, or null when
x is null (Nullable(Float64)). Requires a provider
that supports it (ClickHouse); every other provider and the in-memory provider reject the call.
public double? lgamma(double? x)
Parameters
xdouble?
Returns
log2(double)
log2(x): the base-2 logarithm of x (Float64). Requires a
provider that supports it (ClickHouse); every other provider and the in-memory provider reject
the call.
public double log2(double x)
Parameters
xdouble
Returns
log2(double?)
log2(x) over a nullable argument: the base-2 logarithm, or null when
x is null (Nullable(Float64)). Requires a provider
that supports it (ClickHouse); every other provider and the in-memory provider reject the call.
public double? log2(double? x)
Parameters
xdouble?
Returns
lower_utf8(string?)
lowerUTF8(value): lowercases character-wise (UTF-8 aware), unlike the byte-wise
lower behind ToLowerInvariant(). Requires a provider that supports
it (ClickHouse).
public string? lower_utf8(string? value)
Parameters
valuestring
Returns
make_date(int, int)
makeDate(year, day_of_year): the Date for a year and a 1-based day of that
year (makeDate(2024, 60) is 2024-02-29). A day outside the year's length
yields 1970-01-01 on the server (it is not clamped to the last day). Requires a
provider that supports it (ClickHouse); every other provider and the in-memory provider
reject the call.
public DateTime make_date(int year, int dayOfYear)
Parameters
Returns
make_date(int, int, int)
makeDate(year, month, day): builds a Date from its components. The server
normalizes an out-of-range day into the next month (makeDate(2024, 2, 31) is
2024-03-02) and yields 1970-01-01 when the date falls outside the
Date range (1970-01-01..2149-06-06, so a year below 1970 or above
2149 is clamped to the epoch). That substitution is the server's, not the client's, and is
asserted in the live tests. Requires a provider that supports it (ClickHouse); every other
provider and the in-memory provider reject the call.
public DateTime make_date(int year, int month, int day)
Parameters
Returns
make_date(int?, int?)
The nullable form of make_date(int, int): a NULL component makes the result
NULL (Nullable(Date)), never the epoch.
public DateTime? make_date(int? year, int? dayOfYear)
Parameters
Returns
make_date(int?, int?, int?)
The nullable form of make_date(int, int, int): a NULL component makes the
whole result NULL (Nullable(Date)), never the epoch.
public DateTime? make_date(int? year, int? month, int? day)
Parameters
Returns
make_date32(int, int)
makeDate32(year, day_of_year): the Date32 for a year and a 1-based day of
that year. Requires a provider that supports it (ClickHouse); every other provider and the
in-memory provider reject the call.
public DateTime make_date32(int year, int dayOfYear)
Parameters
Returns
make_date32(int, int, int)
makeDate32(year, month, day): builds a Date32 from its components. The
Date32 range is 1900-01-01..2299-12-31; a date outside it yields
1970-01-01 on the server. Requires a provider that supports it (ClickHouse); every
other provider and the in-memory provider reject the call.
public DateTime make_date32(int year, int month, int day)
Parameters
Returns
make_date32(int?, int?)
The nullable form of make_date32(int, int): NULL stays NULL (Nullable(Date32)).
public DateTime? make_date32(int? year, int? dayOfYear)
Parameters
Returns
make_date32(int?, int?, int?)
The nullable form of make_date32(int, int, int): NULL stays NULL (Nullable(Date32)).
public DateTime? make_date32(int? year, int? month, int? day)
Parameters
Returns
make_date_time(int, int, int, int, int, int)
makeDateTime(year, month, day, hour, minute, second): builds a DateTime in the
server time zone. The DateTime range is 1970-01-01 00:00:00..
2106-02-07 06:28:15; an out-of-range second is normalized
(makeDateTime(2024, 1, 1, 0, 0, 60) is 2024-01-01 00:01:00) and an
out-of-range date yields the epoch on the server. Requires a provider that supports it
(ClickHouse); every other provider and the in-memory provider reject the call.
public DateTime make_date_time(int year, int month, int day, int hour, int minute, int second)
Parameters
Returns
make_date_time(int?, int?, int?, int?, int?, int?)
The nullable form of make_date_time(int, int, int, int, int, int): a NULL component yields NULL (Nullable(DateTime)).
public DateTime? make_date_time(int? year, int? month, int? day, int? hour, int? minute, int? second)
Parameters
Returns
mann_whitney_u_test<TData, TIndex>(TData?, TIndex?)
mannWhitneyUTest(sample_data, sample_index): the Mann-Whitney rank test over the two
non-empty populations encoded by sampleIndex, surfaced as
Tuple(u_statistic, p_value). Requires ClickHouseAggregates
(ClickHouse).
public Tuple<double, double> mann_whitney_u_test<TData, TIndex>(TData? sampleData, TIndex? sampleIndex)
Parameters
sampleDataTDatasampleIndexTIndex
Returns
Type Parameters
TDataTIndex
map_add<TKey, TValue>(IDictionary<TKey, TValue>?, IDictionary<TKey, TValue>?)
mapAdd(map1, map2): the union of the maps, summing the values of repeated keys.
public IDictionary<TKey, TValue>? map_add<TKey, TValue>(IDictionary<TKey, TValue>? map1, IDictionary<TKey, TValue>? map2)
Parameters
map1IDictionary<TKey, TValue>map2IDictionary<TKey, TValue>
Returns
- IDictionary<TKey, TValue>
Type Parameters
TKeyTValue
map_all<TKey, TValue>(Expression<Func<TKey, TValue, bool>>, IDictionary<TKey, TValue>?)
mapAll((k, v) -> predicate, map): true when the lambda returns true for every entry. Kept native (lambda first, then the map) and surfaced as bool, not lowered.
public bool map_all<TKey, TValue>(Expression<Func<TKey, TValue, bool>> predicate, IDictionary<TKey, TValue>? map)
Parameters
predicateExpression<Func<TKey, TValue, bool>>mapIDictionary<TKey, TValue>
Returns
Type Parameters
TKeyTValue
map_apply<TKey, TValue, TResult>(Expression<Func<TKey, TValue, TResult>>, IDictionary<TKey, TValue>?)
The lambda results of the map entries, one per entry in map order, surfaced as exactly
TResult[]. Lowered to
arrayMap((k, v) -> expression, mapKeys(map), mapValues(map)) and wrapped in
cast(... as Array(TResult)), so the lambda may return any scalar value the declared
result admits, including a conditional with a null branch. A reference-type
TResult is cast as Array(Nullable(TResult)) (for example
Array(Nullable(String))), because the bare ClickHouse leaf type does not admit null;
a value-type TResult stays a bare leaf unless it is itself Nullable<T>.
public TResult[] map_apply<TKey, TValue, TResult>(Expression<Func<TKey, TValue, TResult>> function, IDictionary<TKey, TValue>? map)
Parameters
functionExpression<Func<TKey, TValue, TResult>>mapIDictionary<TKey, TValue>
Returns
- TResult[]
One element per map entry, in map order.
Type Parameters
TKeyTValueTResult
map_concat<TKey, TValue>(params IDictionary<TKey, TValue>[])
mapConcat(maps...): the union of the maps; on a repeated key the value of the last map wins.
public IDictionary<TKey, TValue>? map_concat<TKey, TValue>(params IDictionary<TKey, TValue>[] maps)
Parameters
mapsIDictionary<TKey, TValue>[]
Returns
- IDictionary<TKey, TValue>
Type Parameters
TKeyTValue
map_contains_key<TKey, TValue>(IDictionary<TKey, TValue>?, TKey?)
mapContainsKey(map, key): true when the map has the key.
public bool map_contains_key<TKey, TValue>(IDictionary<TKey, TValue>? map, TKey? key)
Parameters
mapIDictionary<TKey, TValue>keyTKey
Returns
Type Parameters
TKeyTValue
map_contains_value<TKey, TValue>(IDictionary<TKey, TValue>?, TValue?)
mapContainsValue(map, value): true when the map has the value.
public bool map_contains_value<TKey, TValue>(IDictionary<TKey, TValue>? map, TValue? value)
Parameters
mapIDictionary<TKey, TValue>valueTValue
Returns
Type Parameters
TKeyTValue
map_exists<TKey, TValue>(Expression<Func<TKey, TValue, bool>>, IDictionary<TKey, TValue>?)
mapExists((k, v) -> predicate, map): true when the lambda returns true for at least one entry. Kept native (lambda first, then the map) and surfaced as bool, not lowered.
public bool map_exists<TKey, TValue>(Expression<Func<TKey, TValue, bool>> predicate, IDictionary<TKey, TValue>? map)
Parameters
predicateExpression<Func<TKey, TValue, bool>>mapIDictionary<TKey, TValue>
Returns
Type Parameters
TKeyTValue
map_filter<TKey, TValue>(Expression<Func<TKey, TValue, bool>>, IDictionary<TKey, TValue>?)
The entries of the map for which the lambda returns true, surfaced as exactly
Tuple<T1, T2>[]. ClickHouse has no native function with this result
shape, so the call is lowered to
arrayFilter(_t -> predicate, arrayZip(mapKeys(map), mapValues(map))); the lambda's
key and value are rebound to the tuple fields (_t.1/_t.2) of one generated
identifier, and the completed lowering is wrapped in
cast(... as Array(Tuple(TKey, TValue))), the declared-type normalisation.
This is a documented result-shape break: earlier releases surfaced
IDictionary<TKey, TValue>, which no provider can materialize from a projected
expression. Read the returned tuples with LINQ once the array is materialized:
filtered.Select(t => t.Item2) for the values, or
filtered.ToDictionary(t => t.Item1, t => t.Item2) for a client-side dictionary.
There is no public path back to a server-side map; use
map_apply<TKey, TValue, TResult>(Expression<Func<TKey, TValue, TResult>>, IDictionary<TKey, TValue>?) to project a different value.
public Tuple<TKey, TValue>[] map_filter<TKey, TValue>(Expression<Func<TKey, TValue, bool>> predicate, IDictionary<TKey, TValue>? map)
Parameters
predicateExpression<Func<TKey, TValue, bool>>mapIDictionary<TKey, TValue>
Returns
- Tuple<TKey, TValue>[]
The matching entries as a one-dimensional Tuple<T1, T2> array, in map order.
Type Parameters
TKeyTValue
map_from_arrays<TKey, TValue>(TKey[]?, TValue[]?)
mapFromArrays(keys, values): a Map(K, V) built from two equal-length arrays,
surfaced as the projectable Tuple<T1, T2> array. A captured or inline
array is bound as one array parameter, an array column stays a column; a length mismatch
and a NULL key element are server errors (Code 190/36). Duplicate keys are preserved in the
tuple array. Requires a provider that supports the map surface.
public Tuple<TKey, TValue>[] map_from_arrays<TKey, TValue>(TKey[]? keys, TValue[]? values)
Parameters
keysTKey[]valuesTValue[]
Returns
- Tuple<TKey, TValue>[]
Type Parameters
TKeyTValue
map_keys<TKey, TValue>(IDictionary<TKey, TValue>?)
mapKeys(map): the keys of the map, surfaced as TKey[]. Requires a provider that supports the map surface (ClickHouse).
public TKey[] map_keys<TKey, TValue>(IDictionary<TKey, TValue>? map)
Parameters
mapIDictionary<TKey, TValue>
Returns
- TKey[]
Type Parameters
TKeyTValue
map_partial_sort<TKey, TValue>(long, IDictionary<TKey, TValue>?)
mapPartialSort(limit, map): the map partially sorted by key in ascending order,
with limit bounding the sorted prefix. The argument order follows the
vendor syntax (limit first); the pinned 25.8 server returns the key-sorted map for
every accepted limit including 0 (verified live). Surfaced as the projectable
Tuple<T1, T2> array. Requires a provider that supports the map surface.
public Tuple<TKey, TValue>[] map_partial_sort<TKey, TValue>(long limit, IDictionary<TKey, TValue>? map)
Parameters
limitlongmapIDictionary<TKey, TValue>
Returns
- Tuple<TKey, TValue>[]
Type Parameters
TKeyTValue
map_populate_series<TKey, TValue>(IDictionary<TKey, TValue>?)
mapPopulateSeries(map): fills the missing integer keys of the map with the value
type default, from the smallest to the largest existing key, surfaced as the projectable
Tuple<T1, T2> array in key order. The key type must be an integer type
(the server rejects Float/String keys with Code 43), which the translation enforces. When
keys repeat, the first value in order of appearance is kept. Requires a provider that
supports the map surface.
public Tuple<TKey, TValue>[] map_populate_series<TKey, TValue>(IDictionary<TKey, TValue>? map)
Parameters
mapIDictionary<TKey, TValue>
Returns
- Tuple<TKey, TValue>[]
Type Parameters
TKeyTValue
map_populate_series<TKey, TValue>(IDictionary<TKey, TValue>?, long)
mapPopulateSeries(map, max): as map_populate_series<TKey, TValue>(IDictionary<TKey, TValue>?),
extended to max; a max below the largest key truncates
the series (verified live: max = 3 over keys 1 and 5 yields 1..3). Requires a
provider that supports the map surface.
public Tuple<TKey, TValue>[] map_populate_series<TKey, TValue>(IDictionary<TKey, TValue>? map, long max)
Parameters
mapIDictionary<TKey, TValue>maxlong
Returns
- Tuple<TKey, TValue>[]
Type Parameters
TKeyTValue
map_reverse_sort<TKey, TValue>(IDictionary<TKey, TValue>?)
mapReverseSort(map): the entries sorted by key in descending order, surfaced as the
projectable Tuple<T1, T2> array (duplicates keep their server order).
Requires a provider that supports the map surface.
public Tuple<TKey, TValue>[] map_reverse_sort<TKey, TValue>(IDictionary<TKey, TValue>? map)
Parameters
mapIDictionary<TKey, TValue>
Returns
- Tuple<TKey, TValue>[]
Type Parameters
TKeyTValue
map_sort<TKey, TValue>(IDictionary<TKey, TValue>?)
The map entries sorted by key, surfaced as exactly Tuple<T1, T2>[].
Lowered to arraySort(_t -> _t.1, arrayZip(mapKeys(map), mapValues(map))) and wrapped
in cast(... as Array(Tuple(TKey, TValue))): the native mapSort returns a map,
which cannot be projected as the tuple array the declaration promises.
public Tuple<TKey, TValue>[] map_sort<TKey, TValue>(IDictionary<TKey, TValue>? map)
Parameters
mapIDictionary<TKey, TValue>
Returns
- Tuple<TKey, TValue>[]
The entries ordered by key as a one-dimensional Tuple<T1, T2> array.
Type Parameters
TKeyTValue
map_subtract<TKey, TValue>(IDictionary<TKey, TValue>?, IDictionary<TKey, TValue>?)
mapSubtract(left, right): the keys of both maps, with the values of
right subtracted from the matching values of
left; keys present in only one map keep their value (a missing key
behaves as zero). The server returns a Map, which is surfaced as the projectable
Tuple<TKey, TValue>[] of arrayZip(mapKeys(...), mapValues(...)) cast to
the declared element types; the native Int64 promotion is normalised by that cast. A
Nullable value component is refused because the server cannot promote a Nullable Map value
against a non-nullable operand. Requires a provider that supports the map surface
(ClickHouse).
public Tuple<TKey, TValue>[] map_subtract<TKey, TValue>(IDictionary<TKey, TValue>? left, IDictionary<TKey, TValue>? right)
Parameters
leftIDictionary<TKey, TValue>rightIDictionary<TKey, TValue>
Returns
- Tuple<TKey, TValue>[]
Type Parameters
TKeyTValue
map_update<TKey, TValue>(IDictionary<TKey, TValue>?, IDictionary<TKey, TValue>?)
mapUpdate(left, right): left with the values of the keys present
in right replaced; keys only in right are added. Both
maps must have the same key and value types (the server rejects a mismatch with Code 43),
which the identical type parameters enforce. Surfaced as the same projectable key/value
tuple array as map_subtract<TKey, TValue>(IDictionary<TKey, TValue>?, IDictionary<TKey, TValue>?); duplicate keys stay in the array.
Requires a provider that supports the map surface (ClickHouse).
public Tuple<TKey, TValue>[] map_update<TKey, TValue>(IDictionary<TKey, TValue>? left, IDictionary<TKey, TValue>? right)
Parameters
leftIDictionary<TKey, TValue>rightIDictionary<TKey, TValue>
Returns
- Tuple<TKey, TValue>[]
Type Parameters
TKeyTValue
map_values<TKey, TValue>(IDictionary<TKey, TValue>?)
mapValues(map): the values of the map, surfaced as TValue[].
public TValue[] map_values<TKey, TValue>(IDictionary<TKey, TValue>? map)
Parameters
mapIDictionary<TKey, TValue>
Returns
- TValue[]
Type Parameters
TKeyTValue
map<TKey, TValue>(params Tuple<TKey, TValue>[])
map(key1, value1, key2, value2, ...): builds a ClickHouse Map from the given
key/value pairs, surfaced as IDictionary<TKey, TValue>. The pairs must be inline
tuples. Requires a provider that supports the map surface (ClickHouse).
public IDictionary<TKey, TValue> map<TKey, TValue>(params Tuple<TKey, TValue>[] pairs)
Parameters
pairsTuple<TKey, TValue>[]
Returns
- IDictionary<TKey, TValue>
Type Parameters
TKeyTValue
match(string?, string?)
match(value, pattern): true when the RE2 pattern matches
value. Requires a provider that supports it (ClickHouse).
public bool match(string? value, string? pattern)
Parameters
Returns
max_intersections_position<TStart, TEnd>(TStart?, TEnd?)
maxIntersectionsPosition(start, end): the position where the maximum number of
intervals intersects (the Position sibling of
max_intersections<TStart, TEnd>(TStart?, TEnd?)). The native integer is narrowed with
toInt32. Requires a provider that supports the ClickHouse aggregate catalogue (see
ClickHouseAggregates; ClickHouse).
public int max_intersections_position<TStart, TEnd>(TStart? start, TEnd? end)
Parameters
startTStartendTEnd
Returns
Type Parameters
TStartTEnd
max_intersections<TStart, TEnd>(TStart?, TEnd?)
maxIntersections(start, end): the maximum number of intervals that intersect at one
point. The native UInt64 is lowered with toInt64. Requires a provider that
supports the ClickHouse aggregate catalogue (see
ClickHouseAggregates; ClickHouse).
public long max_intersections<TStart, TEnd>(TStart? start, TEnd? end)
Parameters
startTStartendTEnd
Returns
Type Parameters
TStartTEnd
max_map<TKey, TValue>(TKey[]?, TValue[]?)
maxMappedArrays(key, value) (the maxMap form): the maximum value per key,
surfaced as Tuple(keys[], values[]) in sorted key order. Requires
ClickHouseAggregates (ClickHouse).
public Tuple<TKey[], TValue[]> max_map<TKey, TValue>(TKey[]? keys, TValue[]? values)
Parameters
keysTKey[]valuesTValue[]
Returns
- Tuple<TKey[], TValue[]>
Type Parameters
TKeyTValue
md4(string?)
MD4(value): the 16-byte MD4 digest rendered as 32 lowercase hexadecimal characters
(lower(hex(MD4(value)))). A null input yields
null.
public string? md4(string? value)
Parameters
valuestring
Returns
md5(string?)
MD5(value): the 16-byte MD5 digest rendered as 32 lowercase hexadecimal characters
(lower(hex(MD5(value)))); a null input yields null.
Requires a provider that supports it (ClickHouse).
public string? md5(string? value)
Parameters
valuestring
Returns
mean_z_test<TData, TIndex>(double, double, double, TData?, TIndex?)
meanZTest(population_variance_x, population_variance_y, confidence_level)(sample_data, sample_index):
the mean z-test, surfaced as Tuple(z_statistic, p_value, confidence_interval_low,
confidence_interval_high). Requires ClickHouseAggregates
(ClickHouse).
public Tuple<double, double, double, double> mean_z_test<TData, TIndex>(double populationVarianceX, double populationVarianceY, double confidenceLevel, TData? sampleData, TIndex? sampleIndex)
Parameters
populationVarianceXdoublepopulationVarianceYdoubleconfidenceLeveldoublesampleDataTDatasampleIndexTIndex
Returns
Type Parameters
TDataTIndex
median<T>(T?)
median(value): the median (the 0.5 quantile).
public double? median<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
metro_hash64(string?)
public ulong? metro_hash64(string? value)
Parameters
valuestring
Returns
min_map<TKey, TValue>(TKey[]?, TValue[]?)
minMappedArrays(key, value) (the minMap form): the minimum value per key, surfaced as Tuple(keys[], values[]) in sorted key order. Requires ClickHouseAggregates (ClickHouse).
public Tuple<TKey[], TValue[]> min_map<TKey, TValue>(TKey[]? keys, TValue[]? values)
Parameters
keysTKey[]valuesTValue[]
Returns
- Tuple<TKey[], TValue[]>
Type Parameters
TKeyTValue
morton_decode(ulong)
mortonDecode(code): the (x, y) coordinates of a two-dimensional Morton code,
rendered as the native mortonDecode(2, code) whose Tuple(UInt64, UInt64)
result is the declared pair. The vendor result arity follows a runtime size argument (up to
eight), so the fixed two-component shape is the one a CLR type can name; other arities are
reachable through raw SQL. Requires a provider that supports it (ClickHouse).
public Tuple<ulong, ulong> morton_decode(ulong code)
Parameters
codeulong
Returns
morton_encode(ulong, ulong)
mortonEncode(x, y): the Morton (Z-order) code of the two unsigned coordinates
(UInt64). Requires a provider that supports it (ClickHouse).
public ulong morton_encode(ulong x, ulong y)
Parameters
Returns
multi_if<TResult>(params MultiIfBranch<TResult>[])
multiIf(cond1, then1, cond2, then2, ..., else): the value of the first true branch, or
the trailing else value. Requires a provider that supports it (see
MultiIf; ClickHouse). Each branch is built with
when<T>(bool, T?) and the final else with otherwise<T>(T?); the
conditions and values must be inline expressions (a captured branch array is rejected). A
numeric TResult is cast to its ClickHouse type so it materialises;
otherwise the result must match the common supertype ClickHouse infers for the branches.
public TResult? multi_if<TResult>(params ClickHouseFunctions.MultiIfBranch<TResult>[] branches)
Parameters
branchesMultiIfBranch<TResult>[]
Returns
- TResult
Type Parameters
TResult
murmur_hash2_32(string?)
murmurHash2_32(value): the 32-bit MurmurHash2 as a signed integer.
public int murmur_hash2_32(string? value)
Parameters
valuestring
Returns
murmur_hash2_64(string?)
murmurHash2_64(value): the 64-bit MurmurHash2 as a signed integer.
public long murmur_hash2_64(string? value)
Parameters
valuestring
Returns
murmur_hash3_128(string?)
murmurHash3_128(value): the 128-bit MurmurHash3 rendered as 32 lowercase hexadecimal
characters (lower(hex(murmurHash3_128(value)))). A null input yields
null.
public string? murmur_hash3_128(string? value)
Parameters
valuestring
Returns
murmur_hash3_32(string?)
murmurHash3_32(value): the 32-bit MurmurHash3 as a signed integer.
public int murmur_hash3_32(string? value)
Parameters
valuestring
Returns
murmur_hash3_64(string?)
murmurHash3_64(value): the 64-bit MurmurHash3 as a signed integer.
public long murmur_hash3_64(string? value)
Parameters
valuestring
Returns
ngram_min_hash(string?, byte?)
ngramMinHash(value[, ngramsize]): the minimum and maximum of the n-gram hashes,
surfaced as the declared Tuple<T1, T2> of two unsigned 64-bit hashes
(Tuple(UInt64, UInt64)). ngramsize is a UInt8 from 1 to 25
and defaults to the vendor's 3 when omitted. The vendor's third parameter hashnum is
fixed at its default 6: it is the arity of the arg-returning sibling only and does not
change this two-hash result. A nullable argument column is rejected by the server because a
Tuple cannot be inside Nullable; pass a non-nullable column or
assumeNotNull(...).
public Tuple<ulong, ulong> ngram_min_hash(string? value, byte? ngramsize = null)
Parameters
Returns
ngram_min_hash_arg(string?, byte?)
ngramMinHashArg(value[, ngramsize]): the n-grams with the minimum and maximum hashes,
surfaced as the vendor's Tuple(Tuple(String, ... six), Tuple(String, ... six)) — the
declared Tuple<T1, T2> of two six-component string tuples. The arity is the
vendor default hashnum = 6; hashnum is deliberately not a parameter because the
result's tuple arity would follow it and no CLR type can name a variable-arity tuple. Short
inputs are padded with empty strings, exactly as the server returns them. A nullable
argument column is rejected by the server (a Tuple cannot be inside Nullable).
public Tuple<Tuple<string, string, string, string, string, string>, Tuple<string, string, string, string, string, string>> ngram_min_hash_arg(string? value, byte? ngramsize = null)
Parameters
Returns
- Tuple<Tuple<string, string, string, string, string, string>, Tuple<string, string, string, string, string, string>>
ngram_sim_hash(string?, byte?)
ngramSimHash(value[, ngramsize]): the n-gram SimHash as the server's unsigned
UInt64; close inputs produce close hashes (compare with bitHammingDistance).
ngramsize is a UInt8 from 1 to 25 (vendor default 3). A
null input yields null.
public ulong? ngram_sim_hash(string? value, byte? ngramsize = null)
Parameters
Returns
ngram_sim_hash_arg(string?, byte?)
ngramSimHashArg(value[, ngramsize]): refused. ClickHouse has no arg-returning SimHash
sibling — ngramSimHash is a single UInt64 aggregate hash and the only
arg-returning n-gram function is ngramMinHashArg. The name is absent from
system.functions on the pinned 25.8.33.6 server (and from the vendor hash-function
reference) and fails with UNKNOWN_FUNCTION, so no version gap or rendering can close
it. This is a non-existent-member refusal, not a CLR-shape limitation.
public Tuple<Tuple<string, string, string, string, string, string>, Tuple<string, string, string, string, string, string>> ngram_sim_hash_arg(string? value, byte? ngramsize = null)
Parameters
Returns
- Tuple<Tuple<string, string, string, string, string, string>, Tuple<string, string, string, string, string, string>>
non_negative_derivative<T>(T, DateTime)
nonNegativeDerivative(value, time) over an ordered window: the non-negative rate of
change of value with respect to time, as
double (Float64). A negative or zero change yields 0, and the first
row of a partition yields 0. The vendor accepts this function only as a window function:
an aggregate call is rejected, and this surface refuses a bare call, so it must be
completed with Over(...). Both arguments must be non-nullable expressions
(Nullable inputs are rejected by the server with BAD_ARGUMENTS), and the
timestamp must be a DateTime. The optional third vendor argument is an
INTERVAL and is not part of the typed surface. Requires a provider that supports it
(ClickHouse).
public WindowFunction<double> non_negative_derivative<T>(T value, DateTime time) where T : struct
Parameters
valueTtimeDateTime
Returns
Type Parameters
T
normalize_utf8_nfc(string?)
normalizeUTF8NFC(value): the Unicode NFC (canonical composition) normalization of
value. An empty input yields the empty string and a null
input yields null. Requires a provider that supports it (ClickHouse).
public string? normalize_utf8_nfc(string? value)
Parameters
valuestring
Returns
normalize_utf8_nfd(string?)
normalizeUTF8NFD(value): the Unicode NFD (canonical decomposition) normalization of
value. Requires a provider that supports it (ClickHouse).
public string? normalize_utf8_nfd(string? value)
Parameters
valuestring
Returns
normalize_utf8_nfkc(string?)
normalizeUTF8NFKC(value): the Unicode NFKC (compatibility composition) normalization of
value. Requires a provider that supports it (ClickHouse).
public string? normalize_utf8_nfkc(string? value)
Parameters
valuestring
Returns
normalize_utf8_nfkd(string?)
normalizeUTF8NFKD(value): the Unicode NFKD (compatibility decomposition) normalization
of value. Requires a provider that supports it (ClickHouse).
public string? normalize_utf8_nfkd(string? value)
Parameters
valuestring
Returns
now()
now(): the current date and time in the server time zone. Requires a provider that supports it (ClickHouse).
public DateTime? now()
Returns
now64()
now64(): the current date and time at millisecond precision
(DateTime64(3), the vendor default scale). The function is non-deterministic and is
evaluated once per query analysis; the live tests assert freshness and precision only.
Requires a provider that supports it (ClickHouse); every other provider and the in-memory
provider reject the call.
public DateTime now64()
Returns
now64(int)
now64(scale): the current date and time at DateTime64(scale). The scale must
be a compile-time constant and is limited to 0..7: scale 8 and 9 carry
sub-100-nanosecond digits that DateTime cannot represent (its tick is 100 ns),
so those scales are refused with a deterministic reason rather than truncated. Requires a
provider that supports it (ClickHouse); every other provider and the in-memory provider
reject the call.
public DateTime now64(int scale)
Parameters
scaleint
Returns
now_in_block()
nowInBlock(): the current date and time at the moment each block is processed
(DateTime). Unlike now64() it is not a constant expression: inside one
block it is fixed, across blocks of a long query it advances. Requires a provider that
supports it (ClickHouse); every other provider and the in-memory provider reject the call.
public DateTime now_in_block()
Returns
numbers(long)
numbers(count) as a FROM source; select Value. Yields
count consecutive integers starting at zero. Requires a provider that supports
table functions (see SupportsTableFunction(string); ClickHouse). Use through
ctx.From(() => ...).
public TvfEntityBuilder<SqlFunctions.INumbersRow> numbers(long count)
Parameters
countlong
Returns
numbers(long, long)
numbers(start, stop) as a FROM source: integers in [start, stop).
public TvfEntityBuilder<SqlFunctions.INumbersRow> numbers(long start, long stop)
Parameters
Returns
numbers(long, long, long)
numbers(start, stop, step) as a FROM source.
public TvfEntityBuilder<SqlFunctions.INumbersRow> numbers(long start, long stop, long step)
Parameters
Returns
numbers_mt(long)
numbers_mt(count) as a FROM source: as numbers(long) but evaluated with
multiple threads.
public TvfEntityBuilder<SqlFunctions.INumbersRow> numbers_mt(long count)
Parameters
countlong
Returns
otherwise<T>(T?)
The final multiIf else value, used when every preceding when<T>(bool, T?)
condition is false. Must be the last branch.
public ClickHouseFunctions.MultiIfBranch<T> otherwise<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
overlay(string?, string?, int, int?)
overlay(value, replacement, offset) or overlay(value, replacement, offset, length):
replaces length characters (by default, the whole
replacement) starting at the 1-based offset of
value. A zero length inserts without removing anything; an
offset past the end, like a negative one, appends. A null
in any argument yields null. Requires a provider that supports it (ClickHouse).
public string? overlay(string? value, string? replacement, int offset, int? length = null)
Parameters
Returns
parse_date_time(string?, string?)
parseDateTime(value, format): parses value with the ClickHouse
format. Requires a provider that supports it (ClickHouse).
public DateTime? parse_date_time(string? value, string? format)
Parameters
Returns
parse_date_time_best_effort(string?, string?)
parseDateTimeBestEffort(value[, timezone]): parses a date/time in any of the supported formats.
public DateTime? parse_date_time_best_effort(string? value, string? timezone = null)
Parameters
Returns
path(string?)
path(url): the path without the query string and the fragment (the leading solidus is
included, repeated separators are preserved). A URL without a path yields an empty string. A
null input yields null. Requires a provider that supports
it (ClickHouse).
public string? path(string? url)
Parameters
urlstring
Returns
path_full(string?)
pathFull(url): the path including the query string and the fragment. A URL without a
path yields an empty string. A null input yields null.
Requires a provider that supports it (ClickHouse).
public string? path_full(string? url)
Parameters
urlstring
Returns
percentile<T>(double, T?)
percentile: not supported by ClickHouse. The native spellings are the
quantile(level)(value) family and median<T>(T?), which differ in their
algorithm and in whether the 0.5 level is fixed; a generic alias would hide that difference.
Referencing this member throws NotSupportedException at translation time.
public double? percentile<T>(double fraction, T? value)
Parameters
fractiondoubleThe percentile fraction, in
[0, 1].valueTThe value whose percentile would be taken.
Returns
- double?
Never returns; the call is refused when the query is translated.
Type Parameters
TThe value expression's type.
port(string?)
port(url): the port of a URL (the server's UInt16 widened to
int with toInt32, an exact widening because the value never exceeds
65535), or 0 when the URL carries no port, cannot be parsed, carries userinfo or names
a port above 65535. A null input yields null. Requires a
provider that supports it (ClickHouse).
public int? port(string? url)
Parameters
urlstring
Returns
- int?
port(string?, ushort)
port(url, defaultPort): the port of a URL, or defaultPort (a
UInt16, 0..65535) when the URL carries no port or cannot be parsed (the vendor returns
the default for a userinfo URL too). A null URL still yields
null, never the default. Requires a provider that supports it
(ClickHouse).
public int? port(string? url, ushort defaultPort)
Parameters
Returns
- int?
pretty_print_json(string?)
prettyPrintJSON(json) is refused: the function was introduced in ClickHouse 26.4 and
does not exist on the pinned 25.8.33.6 server (it is absent from system.functions and
the name fails with UNKNOWN_FUNCTION), so any SQL emitted for it would be rejected by
the target server and no documented equivalent composition exists.
public string? pretty_print_json(string? json)
Parameters
jsonstring
Returns
protocol(string?)
protocol(url): the scheme of a URL without :// (for example https),
case preserved (HTTPS://example.com yields HTTPS). A scheme-less value, a
protocol-relative value (//example.com) and an empty value yield an empty string. A
null input yields null. Requires a provider that supports
it (ClickHouse).
public string? protocol(string? url)
Parameters
urlstring
Returns
quantile_bfloat16<T>(double, T?)
quantileBFloat16(level)(value): the approximate quantile over bfloat16 numbers. Requires ClickHouseAggregates (ClickHouse); the result is Float64.
public double? quantile_bfloat16<T>(double level, T? value)
Parameters
leveldoublevalueT
Returns
Type Parameters
T
quantile_dd<T>(double, double, T?)
quantileDD(relative_accuracy, level)(value): the DD-sketch quantile with a relative
error guarantee; the vendor takes the accuracy first. Requires
ClickHouseAggregates (ClickHouse).
public double? quantile_dd<T>(double relativeAccuracy, double level, T? value)
Parameters
Returns
Type Parameters
T
quantile_exact<T>(double, T?)
quantileExact(level)(value): the exact level quantile.
public double? quantile_exact<T>(double level, T? value)
Parameters
leveldoublevalueT
Returns
Type Parameters
T
quantile_gk<T>(long, double, T?)
quantileGK(accuracy, level)(value): the Greenwald-Khanna quantile; accuracy
is a constant positive integer (100 gives roughly a 1% error). The native result keeps the
input type and is widened with toFloat64. Requires
ClickHouseAggregates (ClickHouse).
public double? quantile_gk<T>(long accuracy, double level, T? value)
Parameters
Returns
Type Parameters
T
quantile_prometheus_histogram<TBound, TCumulative>(double, TBound?, TCumulative?)
quantilePrometheusHistogram(level)(bucket_upper_bound, cumulative_bucket_value): the
PromQL histogram_quantile interpolation over a classic histogram; the highest bucket
must have an upper bound of +Inf. Introduced in 25.10, so the pinned 25.8.33.6 server
raises UNKNOWN_FUNCTION (pinned by the live negative test); the arm renders the
vendor name for servers that ship it. Requires
ClickHouseAggregates (ClickHouse).
public double? quantile_prometheus_histogram<TBound, TCumulative>(double level, TBound? bucketUpperBound, TCumulative? cumulativeBucketValue)
Parameters
leveldoublebucketUpperBoundTBoundcumulativeBucketValueTCumulative
Returns
Type Parameters
TBoundTCumulative
quantile_tdigest<T>(double, T?)
quantileTDigest(level)(value): the approximate quantile through the t-digest algorithm; the native Float32 is widened with toFloat64. Requires ClickHouseAggregates (ClickHouse).
public double? quantile_tdigest<T>(double level, T? value)
Parameters
leveldoublevalueT
Returns
Type Parameters
T
quantile_timing<T>(double, T?)
quantileTiming(level)(value): the approximate quantile optimised for timing data.
public double? quantile_timing<T>(double level, T? value)
Parameters
leveldoublevalueT
Returns
Type Parameters
T
quantile<T>(double, T?)
quantile(level)(value): the approximate level quantile
(0..1). Requires a provider that supports the quantile family (see
QuantileAggregates; ClickHouse).
public double? quantile<T>(double level, T? value)
Parameters
leveldoublevalueT
Returns
Type Parameters
T
quantiles_bfloat16<T>(double[], T?)
quantilesBFloat16(level1, level2, ...)(value): the bfloat16 quantiles. The levels must be an inline array. Requires ClickHouseAggregates (ClickHouse).
public double[] quantiles_bfloat16<T>(double[] levels, T? value)
Parameters
levelsdouble[]valueT
Returns
- double[]
Type Parameters
T
quantiles_dd<T>(double, double[], T?)
quantilesDD(relative_accuracy, level1, level2, ...)(value): the DD-sketch quantiles;
the vendor takes the accuracy first. The levels must be an inline array. Requires
ClickHouseAggregates (ClickHouse).
public double[] quantiles_dd<T>(double relativeAccuracy, double[] levels, T? value)
Parameters
Returns
- double[]
Type Parameters
T
quantiles_exact_high<T>(double[], T?)
quantilesExactHigh(level1, level2, ...)(value): the high-biased exact quantiles. The levels must be an inline array. Requires ClickHouseAggregates (ClickHouse).
public double[] quantiles_exact_high<T>(double[] levels, T? value)
Parameters
levelsdouble[]valueT
Returns
- double[]
Type Parameters
T
quantiles_exact_low<T>(double[], T?)
quantilesExactLow(level1, level2, ...)(value): the low-biased exact quantiles. The levels must be an inline array. Requires ClickHouseAggregates (ClickHouse).
public double[] quantiles_exact_low<T>(double[] levels, T? value)
Parameters
levelsdouble[]valueT
Returns
- double[]
Type Parameters
T
quantiles_exact_weighted<T, TWeight>(double[], T?, TWeight?)
quantilesExactWeighted(level1, level2, ...)(value, weight): the weighted exact
quantiles. The weight must be an unsigned integer on the server (a signed column is rejected
with ILLEGAL_TYPE_OF_ARGUMENT). The levels must be an inline array. Requires
ClickHouseAggregates (ClickHouse).
public double[] quantiles_exact_weighted<T, TWeight>(double[] levels, T? value, TWeight? weight)
Parameters
levelsdouble[]valueTweightTWeight
Returns
- double[]
Type Parameters
TTWeight
quantiles_exact<T>(double[], T?)
quantilesExact(level1, level2, ...)(value): the exact quantiles at every level; the levels must be an inline array and each one is rendered as its own parameter. The native element type follows the input and is normalised to Float64. Requires ClickHouseAggregates (ClickHouse).
public double[] quantiles_exact<T>(double[] levels, T? value)
Parameters
levelsdouble[]valueT
Returns
- double[]
Type Parameters
T
quantiles_gk<T>(long, double[], T?)
quantilesGK(accuracy, level1, level2, ...)(value): the Greenwald-Khanna quantiles;
the vendor takes the integer accuracy first and the levels after it. The levels must be an
inline array. Requires ClickHouseAggregates (ClickHouse).
public double[] quantiles_gk<T>(long accuracy, double[] levels, T? value)
Parameters
Returns
- double[]
Type Parameters
T
quantiles_prometheus_histogram<TBound, TCumulative>(double[], TBound?, TCumulative?)
quantilesPrometheusHistogram(level1, level2, ...)(bucket_upper_bound, cumulative_bucket_value):
the PromQL histogram quantiles over a classic histogram. Introduced in 25.10, so the pinned
25.8.33.6 server raises UNKNOWN_FUNCTION (pinned by the live negative test). The
levels must be an inline array. Requires ClickHouseAggregates
(ClickHouse).
public double[] quantiles_prometheus_histogram<TBound, TCumulative>(double[] levels, TBound? bucketUpperBound, TCumulative? cumulativeBucketValue)
Parameters
levelsdouble[]bucketUpperBoundTBoundcumulativeBucketValueTCumulative
Returns
- double[]
Type Parameters
TBoundTCumulative
quantiles_tdigest<T>(double[], T?)
quantilesTDigest(level1, level2, ...)(value): the t-digest quantiles; the native Array(Float32) is normalised to double[]. The levels must be an inline array. Requires ClickHouseAggregates (ClickHouse).
public double[] quantiles_tdigest<T>(double[] levels, T? value)
Parameters
levelsdouble[]valueT
Returns
- double[]
Type Parameters
T
quantiles_timing<T>(double[], T?)
quantilesTiming(level1, level2, ...)(value): the timing-optimised quantiles; the native Array(Float32) is normalised to double[]. The levels must be an inline array. Requires ClickHouseAggregates (ClickHouse).
public double[] quantiles_timing<T>(double[] levels, T? value)
Parameters
levelsdouble[]valueT
Returns
- double[]
Type Parameters
T
quantiles<T>(double[], T?)
quantiles(level1, level2, ...)(value): the approximate quantiles at every
levels value in one pass. The native result is Array(Float64),
surfaced as double[] and projected directly. Requires a provider that supports the
quantile family (see QuantileAggregates; ClickHouse). The levels
must be an inline array; a captured array is rejected.
public double[] quantiles<T>(double[] levels, T? value)
Parameters
levelsdouble[]valueT
Returns
- double[]
Type Parameters
T
query_string(string?)
queryString(url): the query string without the leading ? and without the
fragment. A URL without a query string yields an empty string. A null input
yields null. Requires a provider that supports it (ClickHouse).
public string? query_string(string? url)
Parameters
urlstring
Returns
query_string_and_fragment(string?)
queryStringAndFragment(url): the query string and the fragment joined by the vendor's
separators (for example b=1#c), without a leading ?. A URL with neither yields
an empty string. A null input yields null. Requires a
provider that supports it (ClickHouse).
public string? query_string_and_fragment(string? url)
Parameters
urlstring
Returns
range(long)
range(end): the integers from 0 up to (but excluding) end.
Returns an array, so it can be projected directly or used as the operand of another array
function (for
example length<T>(T[]) or array_string_concat<T>(T[], string?)).
Requires a provider that supports array functions (see
SupportsArrayFunctions; ClickHouse).
public long[] range(long end)
Parameters
endlong
Returns
- long[]
range(long, long)
range(start, end): the integers in [start, end). Returns an array, so it can be projected directly or nested.
public long[] range(long start, long end)
Parameters
Returns
- long[]
range(long, long, long)
range(start, end, step): the integers in [start, end) with the given step. Returns an array, so it can be projected directly or nested.
public long[] range(long start, long end, long step)
Parameters
Returns
- long[]
rank_corr<TX, TY>(TX?, TY?)
rankCorr(x, y): the Spearman rank correlation coefficient. Requires ClickHouseAggregates (ClickHouse); the result is Float64.
public double rank_corr<TX, TY>(TX? x, TY? y)
Parameters
xTXyTY
Returns
Type Parameters
TXTY
region_hierarchy(uint)
regionHierarchy(id): the region and all its parents down to the root, as region ids.
Requires the embedded geobase dictionaries (see SupportsDictionaries;
ClickHouse).
public uint[] region_hierarchy(uint id)
Parameters
iduint
Returns
- uint[]
region_hierarchy(uint, string)
regionHierarchy(id, geobase): as region_hierarchy(uint) for the named geobase.
public uint[] region_hierarchy(uint id, string geobase)
Parameters
Returns
- uint[]
region_in(uint, uint)
regionIn(lhs, rhs): true when the lhs region is
rhs or one of its descendants (the relationship is reflexive). Requires the
embedded geobase dictionaries (see SupportsDictionaries; ClickHouse).
public bool region_in(uint lhs, uint rhs)
Parameters
Returns
region_in(uint, uint, string)
regionIn(lhs, rhs, geobase): as region_in(uint, uint) for the named geobase.
public bool region_in(uint lhs, uint rhs, string geobase)
Parameters
Returns
region_to_area(uint)
regionToArea(id): the id of the area (vendor region type 5) that contains the region, or 0.
public uint region_to_area(uint id)
Parameters
iduint
Returns
region_to_area(uint, string)
regionToArea(id, geobase): as region_to_area(uint) for the named geobase.
public uint region_to_area(uint id, string geobase)
Parameters
Returns
region_to_city(uint)
regionToCity(id): the id of the city that contains the region, or 0 when there is none.
public uint region_to_city(uint id)
Parameters
iduint
Returns
region_to_city(uint, string)
regionToCity(id, geobase): as region_to_city(uint) for the named geobase.
public uint region_to_city(uint id, string geobase)
Parameters
Returns
region_to_continent(uint)
regionToContinent(id): the id of the nearest continent (vendor region type 1) ancestor of the region, or 0.
public uint region_to_continent(uint id)
Parameters
iduint
Returns
region_to_continent(uint, string)
regionToContinent(id, geobase): as region_to_continent(uint) for the named geobase.
public uint region_to_continent(uint id, string geobase)
Parameters
Returns
region_to_country(uint)
regionToCountry(id): the id of the country (vendor region type 3) that contains the region, or 0.
public uint region_to_country(uint id)
Parameters
iduint
Returns
region_to_country(uint, string)
regionToCountry(id, geobase): as region_to_country(uint) for the named geobase.
public uint region_to_country(uint id, string geobase)
Parameters
Returns
region_to_district(uint)
regionToDistrict(id): the id of the federal district (vendor region type 4) that contains the region, or 0.
public uint region_to_district(uint id)
Parameters
iduint
Returns
region_to_district(uint, string)
regionToDistrict(id, geobase): as region_to_district(uint) for the named geobase.
public uint region_to_district(uint id, string geobase)
Parameters
Returns
region_to_name(uint)
regionToName(id[, lang]): the name of the region in the requested language (or the
server's default geobase language). A missing region yields an empty string, as the vendor
defines; an unsupported language is rejected by the server. Requires the embedded geobase
dictionaries to be configured on the server (see
SupportsDictionaries; ClickHouse).
public string region_to_name(uint id)
Parameters
iduint
Returns
region_to_name(uint, string)
regionToName(id, lang): as region_to_name(uint) with an explicit geobase language.
public string region_to_name(uint id, string lang)
Parameters
Returns
region_to_parent(uint)
regionToParent(id) is refused: no such function exists in ClickHouse 25.8.33.6 (it
fails with UNKNOWN_FUNCTION); use region_hierarchy(uint) and skip the
first element.
public uint region_to_parent(uint id)
Parameters
iduint
Returns
region_to_parents(uint)
regionToParents(id) is refused: no such function exists in ClickHouse 25.8.33.6 (it
fails with UNKNOWN_FUNCTION); use region_hierarchy(uint) and skip the
first element.
public uint[] region_to_parents(uint id)
Parameters
iduint
Returns
- uint[]
region_to_population(uint)
regionToPopulation(id): the population recorded for the region in the geobase, or 0 when it is not recorded.
public uint region_to_population(uint id)
Parameters
iduint
Returns
region_to_population(uint, string)
regionToPopulation(id, geobase): as region_to_population(uint) for the named geobase.
public uint region_to_population(uint id, string geobase)
Parameters
Returns
region_to_top_continent(uint)
regionToTopContinent(id): the id of the highest continent ancestor of the region, or 0.
public uint region_to_top_continent(uint id)
Parameters
iduint
Returns
region_to_top_continent(uint, string)
regionToTopContinent(id, geobase): as region_to_top_continent(uint) for the named geobase.
public uint region_to_top_continent(uint id, string geobase)
Parameters
Returns
reinterpret_as_date_time<TValue>(TValue?)
reinterpretAsDateTime(value): reinterprets the value's bytes as the vendor
DateTime type without any numeric conversion. The bytes are
read in the server's byte order (little-endian on the pinned server), so
reinterpretAsUInt32('abcd') is 0x64636261; a narrower source is zero-padded
to the target width. A null input yields
null. Requires a provider that supports it (ClickHouse).
public DateTime? reinterpret_as_date_time<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
reinterpret_as_date<TValue>(TValue?)
reinterpretAsDate(value): reinterprets the value's bytes as the vendor
Date type without any numeric conversion. The bytes are
read in the server's byte order (little-endian on the pinned server), so
reinterpretAsUInt32('abcd') is 0x64636261; a narrower source is zero-padded
to the target width. A null input yields
null. Requires a provider that supports it (ClickHouse).
public DateTime? reinterpret_as_date<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
reinterpret_as_fixed_string<TValue>(TValue?)
reinterpretAsFixedString(value): reinterprets the value's bytes as the vendor
FixedString type without any numeric conversion. The bytes are
read in the server's byte order (little-endian on the pinned server), so
reinterpretAsUInt32('abcd') is 0x64636261; a narrower source is zero-padded
to the target width. A null input yields
null. Requires a provider that supports it (ClickHouse).
public string? reinterpret_as_fixed_string<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
reinterpret_as_float32<TValue>(TValue?)
reinterpretAsFloat32(value): reinterprets the value's bytes as the vendor
Float32 type without any numeric conversion. The bytes are
read in the server's byte order (little-endian on the pinned server), so
reinterpretAsUInt32('abcd') is 0x64636261; a narrower source is zero-padded
to the target width. A null input yields
null. Requires a provider that supports it (ClickHouse).
public float? reinterpret_as_float32<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
reinterpret_as_float64<TValue>(TValue?)
reinterpretAsFloat64(value): reinterprets the value's bytes as the vendor
Float64 type without any numeric conversion. The bytes are
read in the server's byte order (little-endian on the pinned server), so
reinterpretAsUInt32('abcd') is 0x64636261; a narrower source is zero-padded
to the target width. A null input yields
null. Requires a provider that supports it (ClickHouse).
public double? reinterpret_as_float64<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
reinterpret_as_int128<TValue>(TValue?)
reinterpretAsInt128(value) — refused. The vendor returns Int128, which the driver surfaces as BigInteger; the shared row materializer has no BigInteger accessor, so the bit pattern cannot be materialized into a fixed-width CLR integer.
public object? reinterpret_as_int128<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
reinterpret_as_int16<TValue>(TValue?)
reinterpretAsInt16(value): reinterprets the value's bytes as the vendor
Int16 type without any numeric conversion. The bytes are
read in the server's byte order (little-endian on the pinned server), so
reinterpretAsUInt32('abcd') is 0x64636261; a narrower source is zero-padded
to the target width. A null input yields
null. Requires a provider that supports it (ClickHouse).
public short? reinterpret_as_int16<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
reinterpret_as_int256<TValue>(TValue?)
reinterpretAsInt256(value) — refused. The vendor returns Int256, which the driver surfaces as BigInteger; the shared row materializer has no BigInteger accessor, so the bit pattern cannot be materialized into a fixed-width CLR integer.
public object? reinterpret_as_int256<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
reinterpret_as_int32<TValue>(TValue?)
reinterpretAsInt32(value): reinterprets the value's bytes as the vendor
Int32 type without any numeric conversion. The bytes are
read in the server's byte order (little-endian on the pinned server), so
reinterpretAsUInt32('abcd') is 0x64636261; a narrower source is zero-padded
to the target width. A null input yields
null. Requires a provider that supports it (ClickHouse).
public int? reinterpret_as_int32<TValue>(TValue? value)
Parameters
valueTValue
Returns
- int?
Type Parameters
TValue
reinterpret_as_int64<TValue>(TValue?)
reinterpretAsInt64(value): reinterprets the value's bytes as the vendor
Int64 type without any numeric conversion. The bytes are
read in the server's byte order (little-endian on the pinned server), so
reinterpretAsUInt32('abcd') is 0x64636261; a narrower source is zero-padded
to the target width. A null input yields
null. Requires a provider that supports it (ClickHouse).
public long? reinterpret_as_int64<TValue>(TValue? value)
Parameters
valueTValue
Returns
- long?
Type Parameters
TValue
reinterpret_as_int8<TValue>(TValue?)
reinterpretAsInt8(value): reinterprets the value's bytes as the vendor
Int8 type without any numeric conversion. The bytes are
read in the server's byte order (little-endian on the pinned server), so
reinterpretAsUInt32('abcd') is 0x64636261; a narrower source is zero-padded
to the target width. The vendor returns Int8, which the shared row reader cannot materialize, so the result is widened exactly with toInt16 and surfaced as short. A null input yields
null. Requires a provider that supports it (ClickHouse).
public short? reinterpret_as_int8<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
reinterpret_as_string<TValue>(TValue?)
reinterpretAsString(value): reinterprets the value's bytes as the vendor
String type without any numeric conversion. The bytes are
read in the server's byte order (little-endian on the pinned server), so
reinterpretAsUInt32('abcd') is 0x64636261; a narrower source is zero-padded
to the target width. A null input yields
null. Requires a provider that supports it (ClickHouse).
public string? reinterpret_as_string<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
reinterpret_as_uint128<TValue>(TValue?)
reinterpretAsUInt128(value) — refused. The vendor returns UInt128, which the driver surfaces as BigInteger; the shared row materializer has no BigInteger accessor, so the bit pattern cannot be materialized into a fixed-width CLR integer.
public object? reinterpret_as_uint128<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
reinterpret_as_uint16<TValue>(TValue?)
reinterpretAsUInt16(value): reinterprets the value's bytes as the vendor
UInt16 type without any numeric conversion. The bytes are
read in the server's byte order (little-endian on the pinned server), so
reinterpretAsUInt32('abcd') is 0x64636261; a narrower source is zero-padded
to the target width. The vendor returns UInt16, which the shared row reader cannot materialize, so the result is widened exactly with toInt32 and surfaced as int (0..65535 is lossless). A null input yields
null. Requires a provider that supports it (ClickHouse).
public int? reinterpret_as_uint16<TValue>(TValue? value)
Parameters
valueTValue
Returns
- int?
Type Parameters
TValue
reinterpret_as_uint256<TValue>(TValue?)
reinterpretAsUInt256(value) — refused. The vendor returns UInt256, which the driver surfaces as BigInteger; the shared row materializer has no BigInteger accessor, so the bit pattern cannot be materialized into a fixed-width CLR integer.
public object? reinterpret_as_uint256<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
reinterpret_as_uint32<TValue>(TValue?)
reinterpretAsUInt32(value): reinterprets the value's bytes as the vendor
UInt32 type without any numeric conversion. The bytes are
read in the server's byte order (little-endian on the pinned server), so
reinterpretAsUInt32('abcd') is 0x64636261; a narrower source is zero-padded
to the target width. A null input yields
null. Requires a provider that supports it (ClickHouse).
public uint? reinterpret_as_uint32<TValue>(TValue? value)
Parameters
valueTValue
Returns
- uint?
Type Parameters
TValue
reinterpret_as_uint64<TValue>(TValue?)
reinterpretAsUInt64(value): reinterprets the value's bytes as the vendor
UInt64 type without any numeric conversion. The bytes are
read in the server's byte order (little-endian on the pinned server), so
reinterpretAsUInt32('abcd') is 0x64636261; a narrower source is zero-padded
to the target width. A null input yields
null. Requires a provider that supports it (ClickHouse).
public ulong? reinterpret_as_uint64<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
reinterpret_as_uint8<TValue>(TValue?)
reinterpretAsUInt8(value): reinterprets the value's bytes as the vendor
UInt8 type without any numeric conversion. The bytes are
read in the server's byte order (little-endian on the pinned server), so
reinterpretAsUInt32('abcd') is 0x64636261; a narrower source is zero-padded
to the target width. A null input yields
null. Requires a provider that supports it (ClickHouse).
public byte? reinterpret_as_uint8<TValue>(TValue? value)
Parameters
valueTValue
Returns
- byte?
Type Parameters
TValue
reinterpret_as_uuid<TValue>(TValue?)
reinterpretAsUUID(value): reinterprets the value's bytes as the vendor
UUID type without any numeric conversion. The bytes are
read in the server's byte order (little-endian on the pinned server), so
reinterpretAsUInt32('abcd') is 0x64636261; a narrower source is zero-padded
to the target width. A null input yields
null. Requires a provider that supports it (ClickHouse).
public Guid? reinterpret_as_uuid<TValue>(TValue? value)
Parameters
valueTValue
Returns
- Guid?
Type Parameters
TValue
remote_secure<TRow>(string, string, string)
remoteSecure(addresses, database, table) as a FROM source: the TLS counterpart of
remote<TRow>(string, string, string) (default secure port 9440).
public TvfEntityBuilder<TRow> remote_secure<TRow>(string addresses, string database, string table)
Parameters
Returns
- TvfEntityBuilder<TRow>
Type Parameters
TRow
remote<TRow>(string, string, string)
remote(addresses, database, table) as a FROM source: reads table from
the ClickHouse server(s) at addresses (comma-separated host[:port]
list) without creating a distributed table. The row shape is declared by the caller through
TRow and must match the remote table. Requires a provider that supports
table functions (see SupportsTableFunction(string); ClickHouse). Credentials
come from the server's remote_servers configuration, never from query arguments.
public TvfEntityBuilder<TRow> remote<TRow>(string addresses, string database, string table)
Parameters
Returns
- TvfEntityBuilder<TRow>
Type Parameters
TRow
replace_regexp_all(string?, string?, string?)
replaceRegexpAll(value, pattern, replacement): replaces every RE2 match.
public string? replace_regexp_all(string? value, string? pattern, string? replacement)
Parameters
Returns
replace_regexp_one(string?, string?, string?)
replaceRegexpOne(value, pattern, replacement): replaces the first RE2 match of
pattern (the replacement may reference capture groups with \1).
Requires a provider that supports it (ClickHouse).
public string? replace_regexp_one(string? value, string? pattern, string? replacement)
Parameters
Returns
retention(params bool[])
retention(cond1, cond2, ...): the 1/0 condition mask (the first condition, then the
first-and-second, and so on). Returns an array, so it can be projected directly or used as
the operand of another array function (for example length<T>(T[]) or
array_string_concat<T>(T[], string?)). Requires a provider that supports it (see
SequenceAggregates; ClickHouse). The conditions must be
inline expressions.
public int[] retention(params bool[] conditions)
Parameters
conditionsbool[]
Returns
- int[]
ripemd160(string?)
RIPEMD160(value): the 20-byte RIPEMD-160 digest rendered as 40 lowercase hexadecimal
characters (lower(hex(RIPEMD160(value)))). A null input yields
null.
public string? ripemd160(string? value)
Parameters
valuestring
Returns
round_age(long)
roundAge(age): buckets a human age onto the vendor table — 0 for an age below
one (negative ages included), 17 for 1–17, 18 for 18–24, 25 for 25–34,
35 for 35–44, 45 for 45–54 and 55 for 55 and above. The server returns
UInt8; the arm lowers it with toInt64, so the CLR result is a
long. The buckets are the server's own table (verified on 25.8.33.6), not the
catalog's rounded description. Requires a provider that supports it (ClickHouse); every other
provider and the in-memory provider reject the call.
public long round_age(long age)
Parameters
agelong
Returns
round_age(long?)
roundAge(age) over a nullable argument: the age bucket, or null when
age is null (Nullable(UInt8) lowered to
Nullable(Int64)). Requires a provider that supports it (ClickHouse); every other
provider and the in-memory provider reject the call.
public long? round_age(long? age)
Parameters
agelong?
Returns
- long?
round_bankers(double)
roundBankers(x): banker's rounding (half to even) of a floating-point value to the
nearest integer, so a tie goes to the nearest even digit — roundBankers(2.5) = 2,
roundBankers(3.5) = 4 — and a negative tie keeps the negative sign
(roundBankers(-0.5) is negative zero). nan and ±inf propagate unchanged.
This member is ClickHouse-only rather than a portable Round(double)
representation: the portable call renders the server's round, which agrees for
Float64 but rounds away from zero for Decimal inputs (verified:
round(toDecimal64('2.5', 1)) = 3 while roundBankers(...) = 2), and the portable
API has no integral or negative-scale form. Requires a provider that supports it
(ClickHouse); every other provider and the in-memory provider reject the call.
public double round_bankers(double value)
Parameters
valuedouble
Returns
round_bankers(double, int)
roundBankers(x, N): banker's rounding of a floating-point value to scale
decimal places — scale > 0 rounds to the right of the decimal point,
< 0 to the left and 0 to the integer (roundBankers(1234.5, -2) = 1200). The server
rounds the decimal representation, so roundBankers(2.675, 2) = 2.68; the tie rule still
decides (roundBankers(2.65, 1) = 2.6, roundBankers(2.55, 1) = 2.6). A
null value yields null. Requires a provider that supports
it (ClickHouse); every other provider and the in-memory provider reject the call.
public double round_bankers(double value, int scale)
Parameters
Returns
round_bankers(long, int)
roundBankers(x, N) over an integral value: the same half-to-even rule on the integer
domain, where a negative scale rounds to the left of the decimal point
(roundBankers(45, -1) = 40, roundBankers(1350, -2) = 1400). The server returns
the argument type (Int64 here). Requires a provider that supports it (ClickHouse);
every other provider and the in-memory provider reject the call.
public long round_bankers(long value, int scale)
Parameters
Returns
round_bankers(double?)
roundBankers(x) over a nullable argument: the half-to-even integer, or
null when value is null
(Nullable(Float64)). Requires a provider that supports it (ClickHouse); every other
provider and the in-memory provider reject the call.
public double? round_bankers(double? value)
Parameters
valuedouble?
Returns
round_bankers(double?, int)
roundBankers(x, N) over a nullable argument: the half-to-even value at
scale decimal places, or null when
value is null (Nullable(Float64)). Requires a
provider that supports it (ClickHouse); every other provider and the in-memory provider
reject the call.
public double? round_bankers(double? value, int scale)
Parameters
Returns
round_bankers(long?, int)
roundBankers(x, N) over a nullable integral value: the half-to-even integral value at
scale decimal places, or null when
value is null (Nullable(Int64)). Requires a
provider that supports it (ClickHouse); every other provider and the in-memory provider
reject the call.
public long? round_bankers(long? value, int scale)
Parameters
Returns
- long?
round_down(double, params double[])
roundDown(x, boundaries): the greatest boundary that is not above
value, clamped up to the smallest boundary when the value lies below every
entry (roundDown(-3.5, [1, 2, 5, 10]) = 1) and down to the largest one when it lies
above them. The boundaries need not be ordered. They are bound as one
Array(Float64) parameter, which the server accepts because parameters are substituted
as constants — it rejects a non-constant array column and an empty array outright rather than
substituting a default. Requires a provider that supports it (ClickHouse); every other
provider and the in-memory provider reject the call.
public double round_down(double value, params double[] boundaries)
Parameters
Returns
round_down(double?, params double[])
roundDown(x, boundaries) over a nullable value: the rounded value, or
null when value is null
(Nullable(Float64)). The boundaries are still mandatory and constant. Requires a
provider that supports it (ClickHouse); every other provider and the in-memory provider
reject the call.
public double? round_down(double? value, params double[] boundaries)
Parameters
Returns
round_duration(long)
roundDuration(duration): floors a duration in seconds onto the vendor table
1, 10, 30, 60, 120, 180, 240, 300, 600, 1200, 1800, 3600, 7200, 18000, 36000. A value
below one — zero and every negative duration — yields 0, and the top entry saturates:
roundDuration(36001) = 36000. The server returns UInt16; the arm lowers it with
toInt64, so the CLR result is a long. Requires a provider that supports
it (ClickHouse); every other provider and the in-memory provider reject the call.
public long round_duration(long duration)
Parameters
durationlong
Returns
round_duration(long?)
roundDuration(duration) over a nullable argument: the duration bucket, or
null when duration is null
(Nullable(UInt16) lowered to Nullable(Int64)). Requires a provider that
supports it (ClickHouse); every other provider and the in-memory provider reject the call.
public long? round_duration(long? duration)
Parameters
durationlong?
Returns
- long?
round_to_exp2(double)
roundToExp2(x) over a double: the mantissa is truncated, so the value is
floored onto a — possibly fractional — power of two and the sign is preserved
(roundToExp2(0.7) = 0.5, roundToExp2(-3.7) = -2). Unlike the integral form,
values between zero and one are not collapsed to zero. ±inf stay infinite; a
nan argument yields +inf on the pinned 25.8 server, which is asserted as the
server's behaviour rather than corrected client-side. Requires a provider that supports it
(ClickHouse); every other provider and the in-memory provider reject the call.
public double round_to_exp2(double value)
Parameters
valuedouble
Returns
round_to_exp2(long)
roundToExp2(x) over an integral value: the largest power of two that is not above
value (roundToExp2(100) = 64). A value below one — including every
negative integer — yields 0, and the result saturates at the largest power of two of
the argument width (roundToExp2(Int64.MaxValue) = 2^62). The server returns the
argument type, so an long argument returns Int64. Requires a provider
that supports it (ClickHouse); every other provider and the in-memory provider reject the
call.
public long round_to_exp2(long value)
Parameters
valuelong
Returns
round_to_exp2(double?)
roundToExp2(x) over a nullable double: the power-of-two floor, or
null when value is null
(Nullable(Float64)). Requires a provider that supports it (ClickHouse); every other
provider and the in-memory provider reject the call.
public double? round_to_exp2(double? value)
Parameters
valuedouble?
Returns
round_to_exp2(long?)
roundToExp2(x) over a nullable integral value: the power-of-two floor, or
null when value is null
(Nullable(Int64)). Requires a provider that supports it (ClickHouse); every other
provider and the in-memory provider reject the call.
public long? round_to_exp2(long? value)
Parameters
valuelong?
Returns
- long?
s3<TRow>(string, string, string)
s3(url, format, structure) as a FROM source: reads an object from Amazon S3 or Google
Cloud Storage in the given format and column layout; the row shape is
declared by the caller through TRow. Requires a provider that supports
table functions (see SupportsTableFunction(string); ClickHouse). Credentials
are taken from the server configuration or a named collection; do not pass secrets in the URL.
public TvfEntityBuilder<TRow> s3<TRow>(string url, string format, string structure)
Parameters
Returns
- TvfEntityBuilder<TRow>
Type Parameters
TRow
sequence_count<TTime>(string?, TTime?, params bool[])
sequenceCount(pattern)(timestamp, cond1, cond2, ...): the number of non-overlapping
event chains matching the pattern. The conditions must be inline expressions. The native
UInt64 is lowered with toInt64. Requires
ClickHouseAggregates (ClickHouse).
public long sequence_count<TTime>(string? pattern, TTime? timestamp, params bool[] conditions)
Parameters
Returns
Type Parameters
TTime
sequence_match_events<TTime>(string?, TTime?, params bool[])
sequenceMatchEvents(pattern)(timestamp, cond1, cond2, ...): the timestamps of the
longest matching chain, surfaced as DateTime[] (native Array(DateTime)). The
conditions must be inline expressions. Requires ClickHouseAggregates
(ClickHouse).
public DateTime[] sequence_match_events<TTime>(string? pattern, TTime? timestamp, params bool[] conditions)
Parameters
Returns
- DateTime[]
Type Parameters
TTime
sequence_match<TTime>(string?, TTime?, params bool[])
sequenceMatch(pattern)(timestamp, cond1, cond2, ...): 1 when the event chain
matches the pattern (for example "(?1).*(?2)"), otherwise 0.
Requires a provider that supports it (see
SequenceAggregates; ClickHouse). The conditions must be
inline expressions.
public int sequence_match<TTime>(string? pattern, TTime? timestamp, params bool[] conditions)
Parameters
Returns
Type Parameters
TTime
sequence_next_node<TTime, TEvent>(string?, string?, TTime?, TEvent?, bool, params bool[])
sequenceNextNode(direction, base)(timestamp, event_column, base_condition, event1, ...):
the event value following the matched chain, or null. It is an experimental vendor
aggregate gated by the allow_experimental_funnel_functions setting (without it the
pinned server raises UNKNOWN_AGGREGATE_FUNCTION, pinned by the live negative test).
The events must be inline expressions. Requires
ClickHouseAggregates (ClickHouse).
public string? sequence_next_node<TTime, TEvent>(string? direction, string? basePosition, TTime? timestamp, TEvent? eventColumn, bool baseCondition, params bool[] conditions)
Parameters
directionstringbasePositionstringtimestampTTimeeventColumnTEventbaseConditionboolconditionsbool[]
Returns
Type Parameters
TTimeTEvent
server_timezone()
serverTimezone(): the server's timezone setting as a name (constant unless the
query spans shards). Requires a provider that supports it (ClickHouse); every other
provider and the in-memory provider reject the call.
public string server_timezone()
Returns
sha1(string?)
SHA1(value): the 20-byte SHA-1 digest rendered as 40 lowercase hexadecimal characters.
A null input yields null.
public string? sha1(string? value)
Parameters
valuestring
Returns
sha224(string?)
SHA224(value): the 28-byte SHA-224 digest rendered as 56 lowercase hexadecimal
characters (lower(hex(SHA224(value)))). A null input yields
null. Requires a provider that supports it (ClickHouse).
public string? sha224(string? value)
Parameters
valuestring
Returns
sha256(string?)
SHA256(value): the 32-byte SHA-256 digest rendered as 64 lowercase hexadecimal
characters. A null input yields null.
public string? sha256(string? value)
Parameters
valuestring
Returns
sha384(string?)
SHA384(value): the 48-byte SHA-384 digest rendered as 96 lowercase hexadecimal
characters (lower(hex(SHA384(value)))). A null input yields
null.
public string? sha384(string? value)
Parameters
valuestring
Returns
sha512(string?)
SHA512(value): the 64-byte SHA-512 digest rendered as 128 lowercase hexadecimal
characters. A null input yields null.
public string? sha512(string? value)
Parameters
valuestring
Returns
sha512_256(string?)
SHA512_256(value): the 32-byte SHA-512/256 digest rendered as 64 lowercase
hexadecimal characters (lower(hex(SHA512_256(value)))). A null
input yields null.
public string? sha512_256(string? value)
Parameters
valuestring
Returns
sigmoid(double)
sigmoid(x): the logistic function 1 / (1 + exp(-x)) (Float64). The server
pins sigmoid(0) = 0.5, sigmoid(inf) = 1, sigmoid(-inf) = 0 and — unlike
the CLR formula — sigmoid(nan) = 0. Requires a provider that supports it (ClickHouse);
every other provider and the in-memory provider reject the call.
public double sigmoid(double x)
Parameters
xdouble
Returns
sigmoid(double?)
sigmoid(x) over a nullable argument: the logistic value, or null when
x is null (Nullable(Float64)). Requires a provider
that supports it (ClickHouse); every other provider and the in-memory provider reject the call.
public double? sigmoid(double? x)
Parameters
xdouble?
Returns
simple_json_extract_bool(string?, string?)
simpleJSONExtractBool(json, field): the boolean value of the flat
field key, or false when it is missing, has another
type, or the input is malformed; SQL NULL yields NULL, never
false. The vendor fast-path assumptions of
simple_json_extract_raw(string?, string?) apply.
public bool? simple_json_extract_bool(string? json, string? field)
Parameters
Returns
- bool?
simple_json_extract_float(string?, string?)
simpleJSONExtractFloat(json, field): the Float64 value of the flat
field key, or 0 when it is missing, has another type, or the
input is malformed; SQL NULL yields NULL. The vendor fast-path assumptions
of simple_json_extract_raw(string?, string?) apply.
public double? simple_json_extract_float(string? json, string? field)
Parameters
Returns
simple_json_extract_int(string?, string?)
simpleJSONExtractInt(json, field): the signed 64-bit integer of the flat
field key, or 0 when it is missing, has another type, or the
input is malformed; SQL NULL yields NULL. The vendor fast-path assumptions
of simple_json_extract_raw(string?, string?) apply.
public long? simple_json_extract_int(string? json, string? field)
Parameters
Returns
- long?
simple_json_extract_raw(string?, string?)
simpleJSONExtractRaw(json, field): the raw JSON fragment of the flat
field key, kept as unparsed text. The simple-JSON contract is the
vendor fast path: the field name is a constant, fields are searched at any nesting level,
and the first match wins. A missing field, a wrong value type or malformed input yields an
empty string; SQL NULL yields NULL. Requires a provider that supports the
string-JSON family (see SupportsJsonExtract; ClickHouse).
public string? simple_json_extract_raw(string? json, string? field)
Parameters
Returns
simple_json_extract_string(string?, string?)
simpleJSONExtractString(json, field): the string value of the flat
field key, or an empty string when it is missing, has another type, or
the input is malformed; SQL NULL yields NULL. The vendor fast-path
assumptions of simple_json_extract_raw(string?, string?) apply.
public string? simple_json_extract_string(string? json, string? field)
Parameters
Returns
simple_json_extract_uint(string?, string?)
simpleJSONExtractUInt(json, field): the unsigned 64-bit integer of the flat
field key, or 0 when it is missing, negative, has another type,
or the input is malformed; SQL NULL yields NULL. The vendor fast-path
assumptions of simple_json_extract_raw(string?, string?) apply.
public ulong? simple_json_extract_uint(string? json, string? field)
Parameters
Returns
simple_linear_regression<TX, TY>(TX?, TY?)
simpleLinearRegression(x, y): the slope and intercept of the least-squares line,
surfaced as Tuple(k, b) with both components Float64. Requires a provider that
supports the ClickHouse aggregate catalogue (see
ClickHouseAggregates; ClickHouse).
public Tuple<double, double> simple_linear_regression<TX, TY>(TX? x, TY? y)
Parameters
xTXyTY
Returns
Type Parameters
TXTY
sip_hash128(string?)
sipHash128(value): the 128-bit SipHash rendered as 32 lowercase hexadecimal characters
(lower(hex(sipHash128(value)))). A null input yields
null.
public string? sip_hash128(string? value)
Parameters
valuestring
Returns
sip_hash64(string?)
sipHash64(value): the 64-bit SipHash as a signed integer.
public long sip_hash64(string? value)
Parameters
valuestring
Returns
skew_pop<T>(T?)
skewPop(value): the population skewness. Requires ClickHouseAggregates (ClickHouse); the result is Float64.
public double skew_pop<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
skew_samp<T>(T?)
skewSamp(value): the sample skewness. Requires ClickHouseAggregates (ClickHouse); the result is Float64.
public double skew_samp<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
snowflake_id_to_date_time(ulong?)
snowflakeIDToDateTime(value): the millisecond timestamp component as the server's
32-bit DateTime. Ids whose timestamp is beyond 2106 (the 32-bit DateTime
limit) wrap instead of raising, so UInt64.MaxValue decodes to 1973-04-08; use
snowflake_id_to_date_time64(ulong?) for the exact value of the full range. A
null input yields null. Requires a provider that
supports it (ClickHouse).
public DateTime? snowflake_id_to_date_time(ulong? value)
Parameters
valueulong?
Returns
snowflake_id_to_date_time64(ulong?)
snowflakeIDToDateTime64(value): the millisecond timestamp component as
DateTime64(3), exact for the whole ulong id range (the maximum decodes
to 2109-05-15). A null input yields null. Requires a
provider that supports it (ClickHouse).
public DateTime? snowflake_id_to_date_time64(ulong? value)
Parameters
valueulong?
Returns
soundex(string?)
soundex(value): the four-character Soundex code of value. An input
without an ASCII letter (empty, digits only or non-ASCII) yields 0000. A
null input yields null. Requires a provider that supports
it (ClickHouse).
public string? soundex(string? value)
Parameters
valuestring
Returns
sparkbar<TValue, TWeight>(long, TValue, TValue, TValue?, TWeight?)
sparkbar(buckets, min_x, max_x)(value, weight): the frequency histogram over an
explicit interval; the bounds must have the same type as the value. Requires
ClickHouseAggregates (ClickHouse).
public string? sparkbar<TValue, TWeight>(long buckets, TValue min, TValue max, TValue? value, TWeight? weight)
Parameters
bucketslongminTValuemaxTValuevalueTValueweightTWeight
Returns
Type Parameters
TValueTWeight
sparkbar<TValue, TWeight>(long, TValue?, TWeight?)
sparkbar(buckets)(value, weight): the frequency histogram rendered as a bar string.
The value must be an integer, Date or DateTime column, and the weight carries the frequency.
Requires ClickHouseAggregates (ClickHouse).
public string? sparkbar<TValue, TWeight>(long buckets, TValue? value, TWeight? weight)
Parameters
bucketslongvalueTValueweightTWeight
Returns
Type Parameters
TValueTWeight
split_by_char(string?, string?)
splitByChar(separator, value): splits the string by a single-character separator. Returns an array, so it can be projected directly or used as the operand of another array function.
public string[] split_by_char(string? separator, string? value)
Parameters
Returns
- string[]
split_by_regexp(string?, string?)
splitByRegexp(pattern, value): splits by an RE2 pattern. Returns an array, so it can be projected directly or nested.
public string[] split_by_regexp(string? pattern, string? value)
Parameters
Returns
- string[]
split_by_string(string?, string?)
splitByString(separator, value): splits value by a multi-character
separator. Returns an array, so it can be projected directly or nested. Requires a provider
that supports it (ClickHouse).
public string[] split_by_string(string? separator, string? value)
Parameters
Returns
- string[]
split_by_whitespace(string?)
splitByWhitespace(value): splits on runs of whitespace. Returns an array, so it can be projected directly or nested.
public string[] split_by_whitespace(string? value)
Parameters
valuestring
Returns
- string[]
sqid_decode(string)
sqidDecode(sqid): the numbers encoded by the Sqid string as Array(UInt64);
an empty string yields an empty array and an arbitrary string decodes deterministically to
the number its characters represent. The server rejects a Nullable argument because
an array cannot be inside Nullable, hence the non-nullable parameter. Requires a
provider that supports it (ClickHouse).
public ulong[] sqid_decode(string value)
Parameters
valuestring
Returns
- ulong[]
sqid_encode(params ulong[])
sqidEncode(value, ...): encodes one or more unsigned integers as a Sqid string
(for example sqidEncode(1, 2, 3) is '86Rf07'). At least one value is
required: the server rejects the empty call with NUMBER_OF_ARGUMENTS_DOESNT_MATCH,
so an empty call is refused at translation time. The values must be inline expressions,
not a captured array. Requires a provider that supports it (ClickHouse).
public string sqid_encode(params ulong[] values)
Parameters
valuesulong[]
Returns
sqr(double)
sqr(x): the square of x (Float64). ClickHouse introduced the
sqr spelling in 26.7 and defines it as "the product of x multiplied by itself"
with the multiplication operator's return type, so on the pinned 25.8 server — which rejects the
unknown name — the dialect renders exactly that product ((x * x)) instead of an
unavailable function. Requires a provider that supports it (ClickHouse); every other provider
and the in-memory provider reject the call.
public double sqr(double x)
Parameters
xdouble
Returns
sqr(double?)
sqr(x) over a nullable argument: the square, or null when
x is null (Nullable(Float64)). Requires a provider
that supports it (ClickHouse); every other provider and the in-memory provider reject the call.
public double? sqr(double? x)
Parameters
xdouble?
Returns
starts_with<T>(T[], T[])
startsWith(array, prefix): true when array begins with the
prefix elements, in order. Requires a provider that supports array
functions (see SupportsArrayFunctions; ClickHouse).
public bool starts_with<T>(T[] array, T[] prefix)
Parameters
arrayT[]prefixT[]
Returns
Type Parameters
T
stochastic_linear_regression<TValue, TTarget>(TValue?, TTarget?)
stochasticLinearRegression(...) — refused. The aggregate returns an opaque
AggregateFunction state (a binary serialization) with no typed CLR result; only the
-Merge combinator yields weights, and it requires an AggregateFunction-typed
column the provider cannot read.
public object? stochastic_linear_regression<TValue, TTarget>(TValue? value, TTarget? target)
Parameters
valueTValuetargetTTarget
Returns
Type Parameters
TValueTTarget
stochastic_logistic_regression<TValue, TTarget>(TValue?, TTarget?)
stochasticLogisticRegression(...) — refused. The aggregate returns an opaque
AggregateFunction state (a binary serialization) with no typed CLR result; only the
-Merge combinator yields weights, and it requires an AggregateFunction-typed
column the provider cannot read.
public object? stochastic_logistic_regression<TValue, TTarget>(TValue? value, TTarget? target)
Parameters
valueTValuetargetTTarget
Returns
Type Parameters
TValueTTarget
student_t_test_one_sample<T>(T?, double)
studentTTestOneSample(value, populationMean): the one-sample Student t-test, surfaced
as Tuple(t_statistic, p_value). Introduced after the pinned 25.8.33.6 server, where
the native name raises UNKNOWN_FUNCTION (pinned by the live negative test). Requires
ClickHouseAggregates (ClickHouse).
public Tuple<double, double> student_t_test_one_sample<T>(T? value, double populationMean)
Parameters
valueTpopulationMeandouble
Returns
Type Parameters
T
student_t_test<TData, TIndex>(TData?, TIndex?)
studentTTest(sample_data, sample_index): Student's t-test over the two populations
encoded by sampleIndex (0 = first population, otherwise the second),
surfaced as Tuple(t_statistic, p_value). Requires
ClickHouseAggregates (ClickHouse).
public Tuple<double, double> student_t_test<TData, TIndex>(TData? sampleData, TIndex? sampleIndex)
Parameters
sampleDataTDatasampleIndexTIndex
Returns
Type Parameters
TDataTIndex
substring_index(string?, string?, int)
substringIndex(value, delimiter, count): the substring of value
before the count-th occurrence of the single-character
delimiter; a negative count counts from the end and a
zero count yields the empty string. A multi-character delimiter is rejected by the server. A
null argument yields null. Requires a provider that
supports it (ClickHouse).
public string? substring_index(string? value, string? delimiter, int count)
Parameters
Returns
sum_count<TSum>(TSum)
sumCount(value): the sum and the row count in one pass, surfaced as
Tuple(sum, count) with a long count. Requires
ClickHouseAggregates (ClickHouse).
public Tuple<TSum, long> sum_count<TSum>(TSum value) where TSum : struct
Parameters
valueTSum
Returns
Type Parameters
TSum
sum_kahan<T>(T?)
sumKahan(value): the Kahan-compensated sum as Float64. Requires ClickHouseAggregates (ClickHouse).
public double sum_kahan<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
sum_map_filtered<TKey, TValue>(TKey[], TKey?, TValue?)
sumMapFiltered(keys)(key, value): as sum_map<TKey, TValue>(TKey?, TValue?)
but only for the keysToKeep keys. The keys must be an inline array.
Requires a provider that supports it (ClickHouse).
public IDictionary<TKey, TValue>? sum_map_filtered<TKey, TValue>(TKey[] keysToKeep, TKey? key, TValue? value)
Parameters
keysToKeepTKey[]keyTKeyvalueTValue
Returns
- IDictionary<TKey, TValue>
Type Parameters
TKeyTValue
sum_map<TKey, TValue>(TKey?, TValue?)
sumMap(key, value): aggregates the values per key, surfaced as a ClickHouse Map
(IDictionary<TKey, TValue>). Requires a provider that supports it (ClickHouse).
public IDictionary<TKey, TValue>? sum_map<TKey, TValue>(TKey? key, TValue? value)
Parameters
keyTKeyvalueTValue
Returns
- IDictionary<TKey, TValue>
Type Parameters
TKeyTValue
tcp_port()
The TCP port the server is listening on (CAST(tcpPort() AS Int32)). Requires a provider
that supports it (see SessionInfoFunctions; ClickHouse).
public int tcp_port()
Returns
tgamma(double)
tgamma(x): the gamma function of x (Float64).
tgamma(0) is inf and a negative integer argument is nan (a pole), not an
exception. Requires a provider that supports it (ClickHouse); every other provider and the
in-memory provider reject the call.
public double tgamma(double x)
Parameters
xdouble
Returns
tgamma(double?)
tgamma(x) over a nullable argument: the gamma value, or null when
x is null (Nullable(Float64)). Requires a provider
that supports it (ClickHouse); every other provider and the in-memory provider reject the call.
public double? tgamma(double? x)
Parameters
xdouble?
Returns
theils_u<TX, TY>(TX?, TY?)
theilsU(x, y): Theil's U uncertainty coefficient. Requires ClickHouseAggregates (ClickHouse); the result is Float64.
public double theils_u<TX, TY>(TX? x, TY? y)
Parameters
xTXyTY
Returns
Type Parameters
TXTY
time_series_group_rate_sum<TTime, TValue>(TTime?, TValue?)
timeSeriesGroupRateSum(timestamp, value): the per-timestamp rate sum of a time
series. Removed before the pinned 25.8.33.6 server (the native name raises
UNKNOWN_FUNCTION, pinned live); the arm renders the vendor name for servers that
still ship it. Requires ClickHouseAggregates (ClickHouse).
public Tuple<DateTime, double>[] time_series_group_rate_sum<TTime, TValue>(TTime? timestamp, TValue? value)
Parameters
timestampTTimevalueTValue
Returns
Type Parameters
TTimeTValue
time_series_group_sum<TTime, TValue>(TTime?, TValue?)
timeSeriesGroupSum(timestamp, value): the per-timestamp sum of a time series. The
aggregate was removed before the pinned 25.8.33.6 server, where the native name raises
UNKNOWN_FUNCTION (pinned by the live negative test; the server points at
timeSeriesGroupArray); the arm renders the vendor name for servers that still ship
it. Requires ClickHouseAggregates (ClickHouse).
public Tuple<DateTime, double>[] time_series_group_sum<TTime, TValue>(TTime? timestamp, TValue? value)
Parameters
timestampTTimevalueTValue
Returns
Type Parameters
TTimeTValue
time_series_instant_rate_to_grid<TTimestamp, TValue>(long, long, long, long, TTimestamp?, TValue?)
timeSeriesInstantRateToGrid(start, end, step, staleness)(timestamp, value): the
PromQL irate values on a regular grid, surfaced as double?[] (native
Array(Nullable(Float64)); a grid point without enough samples is null).
Experimental on 25.8: it requires the
allow_experimental_time_series_aggregate_functions setting (the live test sets it
through .Settings(...)). Requires ClickHouseAggregates
(ClickHouse).
public double?[] time_series_instant_rate_to_grid<TTimestamp, TValue>(long startTimestamp, long endTimestamp, long gridStep, long staleness, TTimestamp? timestamp, TValue? value)
Parameters
startTimestamplongendTimestamplonggridSteplongstalenesslongtimestampTTimestampvalueTValue
Returns
- double?[]
Type Parameters
TTimestampTValue
time_series_rate_to_grid<TTimestamp, TValue>(long, long, long, long, TTimestamp?, TValue?)
timeSeriesRateToGrid(start, end, step, staleness)(timestamp, value): the PromQL rate values on a regular grid, surfaced as double?[]. Experimental on 25.8 (the allow_experimental_time_series_aggregate_functions setting). Requires ClickHouseAggregates (ClickHouse).
public double?[] time_series_rate_to_grid<TTimestamp, TValue>(long startTimestamp, long endTimestamp, long gridStep, long staleness, TTimestamp? timestamp, TValue? value)
Parameters
startTimestamplongendTimestamplonggridSteplongstalenesslongtimestampTTimestampvalueTValue
Returns
- double?[]
Type Parameters
TTimestampTValue
time_series_resample_to_grid_with_staleness<TTimestamp, TValue>(long, long, long, long, TTimestamp?, TValue?)
timeSeriesResampleToGridWithStaleness(start, end, step, staleness)(timestamp, value): the time series resampled on a regular grid, surfaced as double?[]. Experimental on 25.8 (the allow_experimental_time_series_aggregate_functions setting). Requires ClickHouseAggregates (ClickHouse).
public double?[] time_series_resample_to_grid_with_staleness<TTimestamp, TValue>(long startTimestamp, long endTimestamp, long gridStep, long staleness, TTimestamp? timestamp, TValue? value)
Parameters
startTimestamplongendTimestamplonggridSteplongstalenesslongtimestampTTimestampvalueTValue
Returns
- double?[]
Type Parameters
TTimestampTValue
time_slot(DateTime)
timeSlot(value): rounds a DateTime down to the start of its half-hour
interval (03:44:59 becomes 03:30:00). Requires a provider that supports it
(ClickHouse); every other provider and the in-memory provider reject the call.
public DateTime time_slot(DateTime value)
Parameters
valueDateTime
Returns
time_slot(DateTime?)
The nullable form of time_slot(DateTime): NULL stays NULL (Nullable(DateTime)).
public DateTime? time_slot(DateTime? value)
Parameters
valueDateTime?
Returns
time_slots(DateTime, uint)
timeSlots(startTime, duration): the 30-minute slot boundaries covering
durationSeconds from startTime (the first slot is the
start's own half-hour). The start is cast to DateTime (a DateTime64 column is
truncated to whole seconds — the slot boundaries carry no sub-second part) and the duration
is sent as UInt32: the server requires exactly that pair (a UInt32 duration is
rejected for a DateTime64 start, which needs Decimal64). There is deliberately
no nullable overload: a NULL start makes the server's
result Nullable(Array(DateTime)), which ClickHouse rejects ("Nested type
Array(DateTime) cannot be inside Nullable type"), so a NULL must be filtered by the caller
instead of silently becoming an empty array. Requires a provider that supports it
(ClickHouse); every other provider and the in-memory provider reject the call.
public DateTime[] time_slots(DateTime startTime, uint durationSeconds)
Parameters
Returns
- DateTime[]
timestamp(string?)
timestamp(value): converts a date/time string to DateTime64(6), i.e. a
DateTime with microsecond precision. An unparsable value raises the server's
parse error, and a NULL argument stays NULL (Nullable(DateTime64(6))). Requires a
provider that supports it (ClickHouse); every other provider and the in-memory provider
reject the call.
public DateTime? timestamp(string? value)
Parameters
valuestring
Returns
timestamp(string?, string?)
timestamp(value, time): converts the date/time string and adds the second
time string to it (timestamp('2023-12-31', '12:00:00.11') is
2023-12-31 12:00:00.110000); an hour beyond 23 rolls into the next day on the
server, and a NULL argument yields NULL. On the pinned 25.8 server this two-argument form
is evaluated for constant arguments only: with a table column as
value the server raises ILLEGAL_COLUMN ("Illegal column
Const(String) of 2nd argument"), which is surfaced as-is rather than simulated with date
arithmetic; use timestamp(string?) for a column. Requires a provider that
supports it (ClickHouse); every other provider and the in-memory provider reject the call.
public DateTime? timestamp(string? value, string? time)
Parameters
Returns
timezone_of(DateTime)
timezoneOf(value): the zone name of a date with time (UTC for a value that
carries none). Requires a provider that supports it (ClickHouse); every other provider and
the in-memory provider reject the call.
public string timezone_of(DateTime value)
Parameters
valueDateTime
Returns
timezone_of(DateTime?)
The nullable form of timezone_of(DateTime): a NULL argument yields NULL.
public string? timezone_of(DateTime? value)
Parameters
valueDateTime?
Returns
timezone_offset(DateTime)
timezoneOffset(value): the zone's offset from UTC in seconds at that instant,
daylight-saving time included (Europe/Berlin is 3600 in January and 7200 in July).
Requires a provider that supports it (ClickHouse); every other provider and the in-memory
provider reject the call.
public int timezone_offset(DateTime value)
Parameters
valueDateTime
Returns
timezone_offset(DateTime?)
The nullable form of timezone_offset(DateTime): NULL stays NULL (Nullable(Int32)).
public int? timezone_offset(DateTime? value)
Parameters
valueDateTime?
Returns
- int?
to_bool<TValue>(TValue?)
toBool(value): converts a numeric or textual value to the vendor Bool.
Numeric 0 is false and every non-zero value (including 0.5 and -1) is
true; the text forms accept true/false, T/F, Y/N,
yes/no, on/off, enable/disable,
enabled/disabled and 1/0 (the server's
bool_true_representation/bool_false_representation settings control the
exact spellings). An unparsable or empty string raises CANNOT_PARSE_BOOL. A
null input yields null. Requires a provider that
supports it (ClickHouse).
public bool? to_bool<TValue>(TValue? value)
Parameters
valueTValue
Returns
- bool?
Type Parameters
TValue
to_date32<T>(T?)
toDate32(value): converts a value to ClickHouse's extended-range Date32.
public DateTime? to_date32<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_date_time<T>(T?)
toDateTime(value): converts a string or date value to a DateTime.
public DateTime? to_date_time<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_date<T>(T?)
toDate(value): converts a string or date/time value to a Date. Requires a
provider that supports the date conversion surface (see
DateConversion; ClickHouse).
public DateTime? to_date<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_day_of_month<T>(T?)
toDayOfMonth(value): the day of the month (1..31).
public int to_day_of_month<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_day_of_week<T>(T?)
toDayOfWeek(value): the day of the week (Monday is 1, Sunday is 7).
public int to_day_of_week<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_day_of_year<T>(T?)
toDayOfYear(value): the day of the year (1..366).
public int to_day_of_year<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_days_in_month(DateTime)
toDaysInMonth(value): the number of days in the month (28..31, leap years
included). The name was introduced in ClickHouse 26.3, so the arm renders the vendor
definition toDayOfMonth(toLastDayOfMonth(value)) — the same value with the same
UInt8 type, lowered to int. Requires a provider that supports it
(ClickHouse); every other provider and the in-memory provider reject the call.
public int to_days_in_month(DateTime value)
Parameters
valueDateTime
Returns
to_days_in_month(DateTime?)
The nullable form of to_days_in_month(DateTime): NULL stays NULL (Nullable(UInt8)).
public int? to_days_in_month(DateTime? value)
Parameters
valueDateTime?
Returns
- int?
to_decimal128<TValue>(TValue?, int)
toDecimal128(value, scale) — refused. Decimal128 carries up to 38 significant decimal digits, while decimal's 128-bit storage has a 96-bit mantissa (28-29 digits); a value above that range cannot be materialized without silent precision loss or OverflowException.
public object? to_decimal128<TValue>(TValue? value, int scale)
Parameters
valueTValuescaleint
Returns
Type Parameters
TValue
to_decimal256<TValue>(TValue?, int)
toDecimal256(value, scale) — refused. Decimal256 carries up to 76 significant decimal digits, while decimal's 128-bit storage has a 96-bit mantissa (28-29 digits); a value above that range cannot be materialized without silent precision loss or OverflowException.
public object? to_decimal256<TValue>(TValue? value, int scale)
Parameters
valueTValuescaleint
Returns
Type Parameters
TValue
to_decimal32_or_default<TValue>(TValue?, int)
toDecimal32OrDefault(value, scale): the vendor form that returns the Decimal(9, scale) zero instead of raising on an unparsable value or a value that does not fit. The scale is a compile-time constant 0..9. A null input yields the zero (the vendor does not propagate NULL through the fallback). Requires a provider that supports it (ClickHouse).
public decimal? to_decimal32_or_default<TValue>(TValue? value, int scale)
Parameters
valueTValuescaleint
Returns
Type Parameters
TValue
to_decimal32_or_default<TValue>(TValue?, int, decimal)
toDecimal32OrDefault(value, scale, defaultValue): the vendor form that returns defaultValue instead of raising. The default is rendered as toDecimal32(defaultValue, scale) so its vendor type matches the target, and the scale is a compile-time constant 0..9. Requires a provider that supports it (ClickHouse).
public decimal? to_decimal32_or_default<TValue>(TValue? value, int scale, decimal defaultValue)
Parameters
Returns
Type Parameters
TValue
to_decimal32_or_null(string?, int)
toDecimal32OrNull(value, scale): the vendor form that returns NULL instead of raising on a value that cannot be parsed or does not fit Decimal(9, scale) (the vendor accepts only a String argument). The scale is a compile-time constant 0..9. A null input yields null. Requires a provider that supports it (ClickHouse).
public decimal? to_decimal32_or_null(string? value, int scale)
Parameters
Returns
to_decimal32<TValue>(TValue?, int)
toDecimal32(value, scale): converts a numeric or textual value to the vendor Decimal(9, scale). The scale is a compile-time constant 0..9 and is rendered as the vendor scale; fractional digits beyond it are truncated (not rounded), and a value with more than 9 significant digits raises ARGUMENT_OUT_OF_BOUND. A non-constant scale is refused with a precise reason. The result fits decimal exactly (9/18 digits are below the 28-29 digits of the 96-bit mantissa). A null input yields null. Requires a provider that supports it (ClickHouse).
public decimal? to_decimal32<TValue>(TValue? value, int scale)
Parameters
valueTValuescaleint
Returns
Type Parameters
TValue
to_decimal64_or_default<TValue>(TValue?, int)
toDecimal64OrDefault(value, scale): the vendor form that returns the Decimal(18, scale) zero instead of raising on an unparsable value or a value that does not fit. The scale is a compile-time constant 0..18. A null input yields the zero (the vendor does not propagate NULL through the fallback). Requires a provider that supports it (ClickHouse).
public decimal? to_decimal64_or_default<TValue>(TValue? value, int scale)
Parameters
valueTValuescaleint
Returns
Type Parameters
TValue
to_decimal64_or_default<TValue>(TValue?, int, decimal)
toDecimal64OrDefault(value, scale, defaultValue): the vendor form that returns defaultValue instead of raising. The default is rendered as toDecimal64(defaultValue, scale) so its vendor type matches the target, and the scale is a compile-time constant 0..18. Requires a provider that supports it (ClickHouse).
public decimal? to_decimal64_or_default<TValue>(TValue? value, int scale, decimal defaultValue)
Parameters
Returns
Type Parameters
TValue
to_decimal64_or_null(string?, int)
toDecimal64OrNull(value, scale): the vendor form that returns NULL instead of raising on a value that cannot be parsed or does not fit Decimal(18, scale) (the vendor accepts only a String argument). The scale is a compile-time constant 0..18. A null input yields null. Requires a provider that supports it (ClickHouse).
public decimal? to_decimal64_or_null(string? value, int scale)
Parameters
Returns
to_decimal64<TValue>(TValue?, int)
toDecimal64(value, scale): converts a numeric or textual value to the vendor Decimal(18, scale). The scale is a compile-time constant 0..18 and is rendered as the vendor scale; fractional digits beyond it are truncated (not rounded), and a value with more than 18 significant digits raises ARGUMENT_OUT_OF_BOUND. A non-constant scale is refused with a precise reason. The result fits decimal exactly (9/18 digits are below the 28-29 digits of the 96-bit mantissa). A null input yields null. Requires a provider that supports it (ClickHouse).
public decimal? to_decimal64<TValue>(TValue? value, int scale)
Parameters
valueTValuescaleint
Returns
Type Parameters
TValue
to_fixed_string<TValue>(TValue?, byte)
toFixedString(value, length): renders the string as the vendor FixedString(N).
A shorter value is padded with zero bytes and a longer one raises
TOO_LARGE_STRING_SIZE (it is never truncated). The length is a compile-time
constant 1..255 and is rendered inline because the vendor rejects a column or parameter in
that position; the result is the exact byte sequence, including the trailing NULs, held
by string. A null input yields null.
Requires a provider that supports it (ClickHouse).
public string? to_fixed_string<TValue>(TValue? value, byte length)
Parameters
valueTValuelengthbyte
Returns
Type Parameters
TValue
to_float32_or_default<TValue>(TValue?)
toFloat32OrDefault(value): the vendor form that returns the Float32 zero instead of raising on an unparsable value (numeric and textual inputs are accepted). A null input yields the zero, not NULL. Requires a provider that supports it (ClickHouse).
public float? to_float32_or_default<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_float32_or_default<TValue>(TValue?, float)
toFloat32OrDefault(value, defaultValue): the vendor form that returns defaultValue instead of raising. The default is rendered as toFloat32(defaultValue) so its vendor type matches the Float32 target. Requires a provider that supports it (ClickHouse).
public float? to_float32_or_default<TValue>(TValue? value, float defaultValue)
Parameters
valueTValuedefaultValuefloat
Returns
Type Parameters
TValue
to_float32_or_null(string?)
toFloat32OrNull(value): the vendor form that returns NULL instead of raising on an unparsable value (the vendor accepts only a String argument). A null input yields null. Requires a provider that supports it (ClickHouse).
public float? to_float32_or_null(string? value)
Parameters
valuestring
Returns
to_float32<TValue>(TValue?)
toFloat32(value): converts a numeric or textual value to the vendor Float32. The text forms accept nan, inf and -inf; a numeric value outside the target range becomes +/-Infinity (the vendor does not raise), while an unparsable string raises CANNOT_PARSE_TEXT and an empty string raises CANNOT_PARSE_NUMBER. A null input yields null. Requires a provider that supports it (ClickHouse).
public float? to_float32<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_float64_or_default<TValue>(TValue?)
toFloat64OrDefault(value): the vendor form that returns the Float64 zero instead of raising on an unparsable value (numeric and textual inputs are accepted). A null input yields the zero, not NULL. Requires a provider that supports it (ClickHouse).
public double? to_float64_or_default<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_float64_or_default<TValue>(TValue?, double)
toFloat64OrDefault(value, defaultValue): the vendor form that returns defaultValue instead of raising. The default is rendered as toFloat64(defaultValue) so its vendor type matches the Float64 target. Requires a provider that supports it (ClickHouse).
public double? to_float64_or_default<TValue>(TValue? value, double defaultValue)
Parameters
valueTValuedefaultValuedouble
Returns
Type Parameters
TValue
to_float64_or_null(string?)
toFloat64OrNull(value): the vendor form that returns NULL instead of raising on an unparsable value (the vendor accepts only a String argument). A null input yields null. Requires a provider that supports it (ClickHouse).
public double? to_float64_or_null(string? value)
Parameters
valuestring
Returns
to_float64<TValue>(TValue?)
toFloat64(value): converts a numeric or textual value to the vendor Float64. The text forms accept nan, inf and -inf; a numeric value outside the target range becomes +/-Infinity (the vendor does not raise), while an unparsable string raises CANNOT_PARSE_TEXT and an empty string raises CANNOT_PARSE_NUMBER. A null input yields null. Requires a provider that supports it (ClickHouse).
public double? to_float64<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_hour<T>(T?)
toHour(value): the hour (0..23).
public int to_hour<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_int128<TValue>(TValue?)
toInt128(value) — refused. ClickHouse Int128 has no exact fixed-width CLR integer type; the driver surfaces it as BigInteger, but the shared row materializer has no BigInteger accessor (SelectExpression.GetDataRecordMethod), so the declared shape cannot be materialized and adding one is a shared-contract change outside this unit.
public object? to_int128<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_int16_or_default<TValue>(TValue?)
toInt16OrDefault(value): the vendor form that returns the Int16 zero instead of raising on an unparsable or out-of-range value (numeric and textual inputs are accepted). A null input yields the zero, not NULL (the vendor does not propagate NULL through the fallback). Requires a provider that supports it (ClickHouse).
public short? to_int16_or_default<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_int16_or_default<TValue>(TValue?, short)
toInt16OrDefault(value, defaultValue): the vendor form that returns defaultValue instead of raising. The default is rendered as toInt16(defaultValue) so its vendor type matches the Int16 target; a constant default outside the target range is refused at translation, while a non-constant one is converted by the server with the vendor's narrowing rule. Requires a provider that supports it (ClickHouse).
public short? to_int16_or_default<TValue>(TValue? value, short defaultValue)
Parameters
valueTValuedefaultValueshort
Returns
Type Parameters
TValue
to_int16_or_null(string?)
toInt16OrNull(value): the vendor form that returns NULL instead of raising on an unparsable or out-of-range value (the vendor accepts only a String argument, so a numeric input is rejected by the server). A null input yields null. Requires a provider that supports it (ClickHouse).
public short? to_int16_or_null(string? value)
Parameters
valuestring
Returns
to_int16<TValue>(TValue?)
toInt16(value): converts a numeric or textual value to the vendor Int16. Numeric narrowing wraps within the target width (two's complement), and a float is truncated toward zero; an unparsable string raises CANNOT_PARSE_TEXT and an empty string raises ATTEMPT_TO_READ_AFTER_EOF. A null input yields null. Requires a provider that supports it (ClickHouse).
public short? to_int16<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_int256<TValue>(TValue?)
toInt256(value) — refused. ClickHouse Int256 has no exact fixed-width CLR integer type; the driver surfaces it as BigInteger, but the shared row materializer has no BigInteger accessor (SelectExpression.GetDataRecordMethod), so the declared shape cannot be materialized and adding one is a shared-contract change outside this unit.
public object? to_int256<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_int32_or_default<TValue>(TValue?)
toInt32OrDefault(value): the vendor form that returns the Int32 zero instead of raising on an unparsable or out-of-range value (numeric and textual inputs are accepted). A null input yields the zero, not NULL (the vendor does not propagate NULL through the fallback). Requires a provider that supports it (ClickHouse).
public int? to_int32_or_default<TValue>(TValue? value)
Parameters
valueTValue
Returns
- int?
Type Parameters
TValue
to_int32_or_default<TValue>(TValue?, int)
toInt32OrDefault(value, defaultValue): the vendor form that returns defaultValue instead of raising. The default is rendered as toInt32(defaultValue) so its vendor type matches the Int32 target; a constant default outside the target range is refused at translation, while a non-constant one is converted by the server with the vendor's narrowing rule. Requires a provider that supports it (ClickHouse).
public int? to_int32_or_default<TValue>(TValue? value, int defaultValue)
Parameters
valueTValuedefaultValueint
Returns
- int?
Type Parameters
TValue
to_int32_or_null(string?)
toInt32OrNull(value): the vendor form that returns NULL instead of raising on an unparsable or out-of-range value (the vendor accepts only a String argument, so a numeric input is rejected by the server). A null input yields null. Requires a provider that supports it (ClickHouse).
public int? to_int32_or_null(string? value)
Parameters
valuestring
Returns
- int?
to_int32<TValue>(TValue?)
toInt32(value): converts a numeric or textual value to the vendor Int32. Numeric narrowing wraps within the target width (two's complement), and a float is truncated toward zero; an unparsable string raises CANNOT_PARSE_TEXT and an empty string raises ATTEMPT_TO_READ_AFTER_EOF. A null input yields null. Requires a provider that supports it (ClickHouse).
public int? to_int32<TValue>(TValue? value)
Parameters
valueTValue
Returns
- int?
Type Parameters
TValue
to_int64_or_default<TValue>(TValue?)
toInt64OrDefault(value): the vendor form that returns the Int64 zero instead of raising on an unparsable or out-of-range value (numeric and textual inputs are accepted). A null input yields the zero, not NULL (the vendor does not propagate NULL through the fallback). Requires a provider that supports it (ClickHouse).
public long? to_int64_or_default<TValue>(TValue? value)
Parameters
valueTValue
Returns
- long?
Type Parameters
TValue
to_int64_or_default<TValue>(TValue?, long)
toInt64OrDefault(value, defaultValue): the vendor form that returns defaultValue instead of raising. The default is rendered as toInt64(defaultValue) so its vendor type matches the Int64 target; a constant default outside the target range is refused at translation, while a non-constant one is converted by the server with the vendor's narrowing rule. Requires a provider that supports it (ClickHouse).
public long? to_int64_or_default<TValue>(TValue? value, long defaultValue)
Parameters
valueTValuedefaultValuelong
Returns
- long?
Type Parameters
TValue
to_int64_or_null(string?)
toInt64OrNull(value): the vendor form that returns NULL instead of raising on an unparsable or out-of-range value (the vendor accepts only a String argument, so a numeric input is rejected by the server). A null input yields null. Requires a provider that supports it (ClickHouse).
public long? to_int64_or_null(string? value)
Parameters
valuestring
Returns
- long?
to_int64<TValue>(TValue?)
toInt64(value): converts a numeric or textual value to the vendor Int64. Numeric narrowing wraps within the target width (two's complement), and a float is truncated toward zero; an unparsable string raises CANNOT_PARSE_TEXT and an empty string raises ATTEMPT_TO_READ_AFTER_EOF. A null input yields null. Requires a provider that supports it (ClickHouse).
public long? to_int64<TValue>(TValue? value)
Parameters
valueTValue
Returns
- long?
Type Parameters
TValue
to_int8_or_default<TValue>(TValue?)
toInt8OrDefault(value): the vendor form that returns the Int8 zero instead of raising on an unparsable or out-of-range value (numeric and textual inputs are accepted). The vendor returns Int8, which the shared row reader cannot materialize, so the result is widened exactly with toInt16 and surfaced as short. A null input yields the zero, not NULL (the vendor does not propagate NULL through the fallback). Requires a provider that supports it (ClickHouse).
public short? to_int8_or_default<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_int8_or_default<TValue>(TValue?, short)
toInt8OrDefault(value, defaultValue): the vendor form that returns defaultValue instead of raising. The default is rendered as toInt8(defaultValue) so its vendor type matches the Int8 target; a constant default outside the target range is refused at translation, while a non-constant one is converted by the server with the vendor's narrowing rule. Requires a provider that supports it (ClickHouse).
public short? to_int8_or_default<TValue>(TValue? value, short defaultValue)
Parameters
valueTValuedefaultValueshort
Returns
Type Parameters
TValue
to_int8_or_null(string?)
toInt8OrNull(value): the vendor form that returns NULL instead of raising on an unparsable or out-of-range value (the vendor accepts only a String argument, so a numeric input is rejected by the server). The vendor returns Int8, which the shared row reader cannot materialize, so the result is widened exactly with toInt16 and surfaced as short. A null input yields null. Requires a provider that supports it (ClickHouse).
public short? to_int8_or_null(string? value)
Parameters
valuestring
Returns
to_int8<TValue>(TValue?)
toInt8(value): converts a numeric or textual value to the vendor Int8. Numeric narrowing wraps within the target width (two's complement), for example 128 becomes -128, and a float is truncated toward zero; an unparsable string raises CANNOT_PARSE_TEXT and an empty string raises ATTEMPT_TO_READ_AFTER_EOF. The vendor returns Int8, which the shared row reader cannot materialize, so the result is widened exactly with toInt16 and surfaced as short. A null input yields null. Requires a provider that supports it (ClickHouse).
public short? to_int8<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_interval_day<TValue>(TValue?)
toIntervalDay(value) — refused. The vendor returns the ClickHouse-only IntervalDay type, which has no CLR representation and is usable only inside date arithmetic; the provider driver itself cannot materialize it (ArgumentException 'Unknown type: IntervalDay' on 25.8.33.6).
public object? to_interval_day<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_interval_hour<TValue>(TValue?)
toIntervalHour(value) — refused. The vendor returns the ClickHouse-only IntervalHour type, which has no CLR representation and is usable only inside date arithmetic; the provider driver itself cannot materialize it (ArgumentException 'Unknown type: IntervalHour' on 25.8.33.6).
public object? to_interval_hour<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_interval_microsecond<TValue>(TValue?)
toIntervalMicrosecond(value) — refused. The vendor returns the ClickHouse-only IntervalMicrosecond type, which has no CLR representation and is usable only inside date arithmetic; the provider driver itself cannot materialize it (ArgumentException 'Unknown type: IntervalMicrosecond' on 25.8.33.6).
public object? to_interval_microsecond<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_interval_millisecond<TValue>(TValue?)
toIntervalMillisecond(value) — refused. The vendor returns the ClickHouse-only IntervalMillisecond type, which has no CLR representation and is usable only inside date arithmetic; the provider driver itself cannot materialize it (ArgumentException 'Unknown type: IntervalMillisecond' on 25.8.33.6).
public object? to_interval_millisecond<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_interval_minute<TValue>(TValue?)
toIntervalMinute(value) — refused. The vendor returns the ClickHouse-only IntervalMinute type, which has no CLR representation and is usable only inside date arithmetic; the provider driver itself cannot materialize it (ArgumentException 'Unknown type: IntervalMinute' on 25.8.33.6).
public object? to_interval_minute<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_interval_month<TValue>(TValue?)
toIntervalMonth(value) — refused. The vendor returns the ClickHouse-only IntervalMonth type, which has no CLR representation and is usable only inside date arithmetic; the provider driver itself cannot materialize it (ArgumentException 'Unknown type: IntervalMonth' on 25.8.33.6).
public object? to_interval_month<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_interval_nanosecond<TValue>(TValue?)
toIntervalNanosecond(value) — refused. The vendor returns the ClickHouse-only IntervalNanosecond type, which has no CLR representation and is usable only inside date arithmetic; the provider driver itself cannot materialize it (ArgumentException 'Unknown type: IntervalNanosecond' on 25.8.33.6).
public object? to_interval_nanosecond<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_interval_quarter<TValue>(TValue?)
toIntervalQuarter(value) — refused. The vendor returns the ClickHouse-only IntervalQuarter type, which has no CLR representation and is usable only inside date arithmetic; the provider driver itself cannot materialize it (ArgumentException 'Unknown type: IntervalQuarter' on 25.8.33.6).
public object? to_interval_quarter<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_interval_second<TValue>(TValue?)
toIntervalSecond(value) — refused. The vendor returns the ClickHouse-only IntervalSecond type, which has no CLR representation and is usable only inside date arithmetic; the provider driver itself cannot materialize it (ArgumentException 'Unknown type: IntervalSecond' on 25.8.33.6).
public object? to_interval_second<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_interval_week<TValue>(TValue?)
toIntervalWeek(value) — refused. The vendor returns the ClickHouse-only IntervalWeek type, which has no CLR representation and is usable only inside date arithmetic; the provider driver itself cannot materialize it (ArgumentException 'Unknown type: IntervalWeek' on 25.8.33.6).
public object? to_interval_week<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_interval_year<TValue>(TValue?)
toIntervalYear(value) — refused. The vendor returns the ClickHouse-only IntervalYear type, which has no CLR representation and is usable only inside date arithmetic; the provider driver itself cannot materialize it (ArgumentException 'Unknown type: IntervalYear' on 25.8.33.6).
public object? to_interval_year<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_ipv4(uint?)
toIPv4(value) from a nullable UInt32: the canonical dotted-quad text, or
null (Nullable(IPv4)). Requires a provider that supports it
(ClickHouse).
public string? to_ipv4(uint? value)
Parameters
valueuint?
Returns
to_ipv4(string?)
toIPv4(value): parses the dotted-quad text into the native IPv4 type and renders
the address back as its canonical dotted-quad text (toString). The library's row
materializer has no address type, so the exact canonical text is the CLR shape; the server
still produces and consumes the native IPv4 value, and
ipv4_string_to_num(string?) exposes its UInt32 storage form. A malformed
value raises the vendor's CANNOT_PARSE_IPV4 error; a null input
yields null. Requires a provider that supports it (ClickHouse).
public string? to_ipv4(string? value)
Parameters
valuestring
Returns
to_ipv4(uint)
toIPv4(value) from a UInt32 address, rendered as the canonical dotted-quad text
(the vendor converts the numeric form to the native IPv4 value first). Requires a
provider that supports it (ClickHouse).
public string to_ipv4(uint value)
Parameters
valueuint
Returns
to_ipv6(string?)
toIPv6(value): parses the textual IPv6 address into the native IPv6 type and
renders it back as its canonical compressed text (toString); an IPv4 text is accepted
as its IPv4-mapped form (1.2.3.4 becomes ::ffff:1.2.3.4). The library's row
materializer has no address type, so the canonical text is the CLR shape, while
ipv6_string_to_num(string?) exposes the FixedString(16) storage form as
hex. A malformed value raises CANNOT_PARSE_IPV6; a null input yields
null. Requires a provider that supports it (ClickHouse).
public string? to_ipv6(string? value)
Parameters
valuestring
Returns
to_iso_year(DateTime)
toISOYear(value): the ISO-8601 week-based year, which differs from the calendar year
around New Year (toISOYear(2024-01-01) is 2024, toISOYear(2021-01-01) is
2020). The server returns UInt16, surfaced as int. Requires a provider
that supports it (ClickHouse); every other provider and the in-memory provider reject the
call.
public int to_iso_year(DateTime value)
Parameters
valueDateTime
Returns
to_iso_year(DateTime?)
The nullable form of to_iso_year(DateTime): NULL stays NULL (Nullable(UInt16)).
public int? to_iso_year(DateTime? value)
Parameters
valueDateTime?
Returns
- int?
to_json_string<T>(T?)
toJSONString(value): serialises value to its JSON text
representation. Requires a provider that supports the JSON functions (see
SupportsJsonExtract; ClickHouse).
public string? to_json_string<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_last_day_of_week(DateTime)
toLastDayOfWeek(value): rounds a date up to the nearest Saturday (mode 0, the
default). The result is a Date. Requires a provider that supports it (ClickHouse);
every other provider and the in-memory provider reject the call.
public DateTime to_last_day_of_week(DateTime value)
Parameters
valueDateTime
Returns
to_last_day_of_week(DateTime, int)
toLastDayOfWeek(value, mode): rounds up to the last day of the week selected by the
toWeek mode (0..9): even modes end on Saturday, odd modes on Sunday. Requires
a provider that supports it (ClickHouse); every other provider and the in-memory provider
reject the call.
public DateTime to_last_day_of_week(DateTime value, int mode)
Parameters
Returns
to_last_day_of_week(DateTime?)
The nullable form of to_last_day_of_week(DateTime): NULL stays NULL (Nullable(Date)).
public DateTime? to_last_day_of_week(DateTime? value)
Parameters
valueDateTime?
Returns
to_last_day_of_week(DateTime?, int?)
The nullable form of to_last_day_of_week(DateTime, int): NULL stays NULL.
public DateTime? to_last_day_of_week(DateTime? value, int? mode)
Parameters
Returns
to_low_cardinality<TValue>(TValue?)
toLowCardinality(value): wraps the value in the vendor LowCardinality(T)
storage type. The wrapper has no value-level effect, so the result is the underlying CLR
value; a Nullable column becomes LowCardinality(Nullable(T)). The vendor rejects a
bare NULL literal because its type is Nullable(Nothing) (a tested
expected-negative), while a nullable column and a NULL value inside it are accepted. A
null input yields null. Requires a provider that
supports it (ClickHouse).
public string? to_low_cardinality<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_minute<T>(T?)
toMinute(value): the minute (0..59).
public int to_minute<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_modified_julian_day(string?)
toModifiedJulianDay(date): the Modified Julian Day number (Int32) of a
proleptic Gregorian date given in text form YYYY-MM-DD. The accepted range is
0000-01-01..9999-12-31 — wider than DateTime in the lower
direction, which is why the argument is a string and the result an
int: nothing is narrowed to a CLR date. An unparsable or invalid date (a
30 February, a five-digit year) raises the server's parse error, surfaced rather than
defaulted, and a NULL argument yields NULL (Nullable(Int32)) without parsing.
Requires a provider that supports it (ClickHouse); every other provider and the
in-memory provider reject the call.
public int? to_modified_julian_day(string? date)
Parameters
datestring
Returns
- int?
to_monday<T>(T?)
toMonday(value): the Monday of the ISO week at 00:00:00.
public DateTime? to_monday<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_month<T>(T?)
toMonth(value): the month (1..12).
public int to_month<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_quarter<T>(T?)
toQuarter(value): the quarter (1..4).
public int to_quarter<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_second<T>(T?)
toSecond(value): the second (0..59).
public int to_second<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_start_of_day<T>(T?)
toStartOfDay(value): midnight of the day.
public DateTime? to_start_of_day<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_start_of_fifteen_minutes(DateTime)
toStartOfFifteenMinutes(value): truncates a DateTime to the start of its
fifteen-minute interval. The argument must be a date with time (a Date is rejected
by the server). Requires a provider that supports it (ClickHouse); every other provider and
the in-memory provider reject the call.
public DateTime to_start_of_fifteen_minutes(DateTime value)
Parameters
valueDateTime
Returns
to_start_of_fifteen_minutes(DateTime?)
The nullable form of to_start_of_fifteen_minutes(DateTime): NULL stays NULL.
public DateTime? to_start_of_fifteen_minutes(DateTime? value)
Parameters
valueDateTime?
Returns
to_start_of_five_minutes(DateTime)
toStartOfFiveMinutes(value): truncates a DateTime to the start of its
five-minute interval. Requires a provider that supports it (ClickHouse); every other
provider and the in-memory provider reject the call.
public DateTime to_start_of_five_minutes(DateTime value)
Parameters
valueDateTime
Returns
to_start_of_five_minutes(DateTime?)
The nullable form of to_start_of_five_minutes(DateTime): NULL stays NULL.
public DateTime? to_start_of_five_minutes(DateTime? value)
Parameters
valueDateTime?
Returns
to_start_of_hour<T>(T?)
toStartOfHour(value): the start of the hour.
public DateTime? to_start_of_hour<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_start_of_interval(DateTime, long, string)
toStartOfInterval(value, INTERVAL amount unit): the general truncation over a
calendar grid anchored at the vendor's fixed points (year 0, 1900 for quarters, the epoch
for day and below; weeks start on Monday). unit must be a compile-time
string literal naming a whole-second-or-larger unit — second, minute,
hour, day, week, month, quarter or year; the
sub-second units are refused because a DateTime argument binds a
DateTime and the server rejects them for that type. The amount must be positive
(zero or negative is refused by the server and surfaced, never substituted).
Requires a provider that supports it (ClickHouse); every other provider and the in-memory
provider reject the call.
public DateTime to_start_of_interval(DateTime value, long amount, string unit)
Parameters
Returns
to_start_of_interval(DateTime, long, string, DateTime)
toStartOfInterval(value, INTERVAL amount unit, origin): the TimescaleDB
time_bucket() form, where the grid is anchored at origin instead
of the vendor's fixed point. The value and the origin are both cast to DateTime (the
server requires the same type for them). The origin must not be after the value (the
server raises BAD_ARGUMENTS otherwise). Requires a provider that supports it (ClickHouse); every
other provider and the in-memory provider reject the call.
public DateTime to_start_of_interval(DateTime value, long amount, string unit, DateTime origin)
Parameters
Returns
to_start_of_interval(DateTime?, long, string)
The nullable form of to_start_of_interval(DateTime, long, string): NULL stays NULL (Nullable(DateTime)).
public DateTime? to_start_of_interval(DateTime? value, long amount, string unit)
Parameters
Returns
to_start_of_interval(DateTime?, long, string, DateTime)
The nullable form of to_start_of_interval(DateTime, long, string, DateTime): NULL stays NULL.
public DateTime? to_start_of_interval(DateTime? value, long amount, string unit, DateTime origin)
Parameters
Returns
to_start_of_minute<T>(T?)
toStartOfMinute(value): the start of the minute.
public DateTime? to_start_of_minute<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_start_of_month<T>(T?)
toStartOfMonth(value): the first day of the month at 00:00:00.
public DateTime? to_start_of_month<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_start_of_quarter<T>(T?)
toStartOfQuarter(value): the first day of the quarter at 00:00:00.
public DateTime? to_start_of_quarter<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_start_of_second<T>(T?)
toStartOfSecond(value): the start of the second.
public DateTime? to_start_of_second<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_start_of_ten_minutes(DateTime)
toStartOfTenMinutes(value): truncates a DateTime to the start of its
ten-minute interval. Requires a provider that supports it (ClickHouse); every other
provider and the in-memory provider reject the call.
public DateTime to_start_of_ten_minutes(DateTime value)
Parameters
valueDateTime
Returns
to_start_of_ten_minutes(DateTime?)
The nullable form of to_start_of_ten_minutes(DateTime): NULL stays NULL.
public DateTime? to_start_of_ten_minutes(DateTime? value)
Parameters
valueDateTime?
Returns
to_start_of_week<T>(T?)
toStartOfWeek(value): the start of the week at 00:00:00. ClickHouse starts the week on
Sunday by default (unlike ISO weeks); use to_monday<T>(T?) for the Monday start.
public DateTime? to_start_of_week<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_start_of_year<T>(T?)
toStartOfYear(value): the first day of the year at 00:00:00.
public DateTime? to_start_of_year<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_string<TValue>(TValue?)
toString(value): the vendor string representation of a scalar value. Float
formatting is the shortest representation that round-trips (0.1 for a
Float32), DateTime is formatted in the server time zone (yyyy-MM-dd HH:mm:ss,
with the fractional part for DateTime64), Bool is true/false, Decimal
drops trailing zeros and UUID is the canonical hyphenated text. A
null input yields null. Requires a provider that
supports it (ClickHouse).
public string? to_string<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_time(DateTime)
toTime(value): the time component of a date with time, represented as a
DateTime on the vendor's fixed date (currently 1970-01-02; the vendor
documents that the exact date is an implementation detail and that the value is meant for
differences, not standalone display). The arm renders the stable vendor name
toTimeWithFixedDate, which is the legacy toTime on 25.8 (the name
toTime was reassigned in 26.7); the two are asserted equal on the pinned server.
Sub-second digits are dropped by the server. Requires a provider that supports it
(ClickHouse); every other provider and the in-memory provider reject the call.
public DateTime to_time(DateTime value)
Parameters
valueDateTime
Returns
to_time(DateTime?)
The nullable form of to_time(DateTime): NULL stays NULL (Nullable(DateTime)).
public DateTime? to_time(DateTime? value)
Parameters
valueDateTime?
Returns
to_time64(DateTime, int)
toTime64(value, scale) — refused. The function returns the ClickHouse
Time64(scale) type; the provider maps TimeSpan to the Int64 duration
storage policy (SupportsNativeDuration is false for ClickHouse),
so a typed TimeSpan projection of a Time64 value cannot be
materialized and no other CLR value type carries a time of day with the declared scale.
The refusal is deterministic and tested; read the value through ExecuteRaw with a
TimeSpan projection if a raw read is what you need.
public TimeSpan to_time64(DateTime value, int scale)
Parameters
Returns
to_uint128<TValue>(TValue?)
toUInt128(value) — refused. ClickHouse UInt128 has no exact fixed-width CLR integer type; the driver surfaces it as BigInteger, but the shared row materializer has no BigInteger accessor (SelectExpression.GetDataRecordMethod), so the declared shape cannot be materialized and adding one is a shared-contract change outside this unit.
public object? to_uint128<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_uint16_or_default<TValue>(TValue?)
toUInt16OrDefault(value): the vendor form that returns the UInt16 zero instead of raising on an unparsable or out-of-range value (numeric and textual inputs are accepted). The vendor returns UInt16, which the shared row reader cannot materialize, so the result is widened exactly with toInt32 and surfaced as int (0..65535 is lossless). A null input yields the zero, not NULL (the vendor does not propagate NULL through the fallback). Requires a provider that supports it (ClickHouse).
public int? to_uint16_or_default<TValue>(TValue? value)
Parameters
valueTValue
Returns
- int?
Type Parameters
TValue
to_uint16_or_default<TValue>(TValue?, int)
toUInt16OrDefault(value, defaultValue): the vendor form that returns defaultValue instead of raising. The default is rendered as toUInt16(defaultValue) so its vendor type matches the UInt16 target; a constant default outside the target range is refused at translation, while a non-constant one is converted by the server with the vendor's narrowing rule. Requires a provider that supports it (ClickHouse).
public int? to_uint16_or_default<TValue>(TValue? value, int defaultValue)
Parameters
valueTValuedefaultValueint
Returns
- int?
Type Parameters
TValue
to_uint16_or_null(string?)
toUInt16OrNull(value): the vendor form that returns NULL instead of raising on an unparsable or out-of-range value (the vendor accepts only a String argument, so a numeric input is rejected by the server). The vendor returns UInt16, which the shared row reader cannot materialize, so the result is widened exactly with toInt32 and surfaced as int (0..65535 is lossless). A null input yields null. Requires a provider that supports it (ClickHouse).
public int? to_uint16_or_null(string? value)
Parameters
valuestring
Returns
- int?
to_uint16<TValue>(TValue?)
toUInt16(value): converts a numeric or textual value to the vendor UInt16. Numeric narrowing wraps modulo the target width, and a float is truncated toward zero; an unparsable string raises CANNOT_PARSE_TEXT and an empty string raises ATTEMPT_TO_READ_AFTER_EOF. The vendor returns UInt16, which the shared row reader cannot materialize, so the result is widened exactly with toInt32 and surfaced as int (0..65535 is lossless). A null input yields null. Requires a provider that supports it (ClickHouse).
public int? to_uint16<TValue>(TValue? value)
Parameters
valueTValue
Returns
- int?
Type Parameters
TValue
to_uint256<TValue>(TValue?)
toUInt256(value) — refused. ClickHouse UInt256 has no exact fixed-width CLR integer type; the driver surfaces it as BigInteger, but the shared row materializer has no BigInteger accessor (SelectExpression.GetDataRecordMethod), so the declared shape cannot be materialized and adding one is a shared-contract change outside this unit.
public object? to_uint256<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_uint32_or_default<TValue>(TValue?)
toUInt32OrDefault(value): the vendor form that returns the UInt32 zero instead of raising on an unparsable or out-of-range value (numeric and textual inputs are accepted). A null input yields the zero, not NULL (the vendor does not propagate NULL through the fallback). Requires a provider that supports it (ClickHouse).
public uint? to_uint32_or_default<TValue>(TValue? value)
Parameters
valueTValue
Returns
- uint?
Type Parameters
TValue
to_uint32_or_default<TValue>(TValue?, uint)
toUInt32OrDefault(value, defaultValue): the vendor form that returns defaultValue instead of raising. The default is rendered as toUInt32(defaultValue) so its vendor type matches the UInt32 target; a constant default outside the target range is refused at translation, while a non-constant one is converted by the server with the vendor's narrowing rule. Requires a provider that supports it (ClickHouse).
public uint? to_uint32_or_default<TValue>(TValue? value, uint defaultValue)
Parameters
valueTValuedefaultValueuint
Returns
- uint?
Type Parameters
TValue
to_uint32_or_null(string?)
toUInt32OrNull(value): the vendor form that returns NULL instead of raising on an unparsable or out-of-range value (the vendor accepts only a String argument, so a numeric input is rejected by the server). A null input yields null. Requires a provider that supports it (ClickHouse).
public uint? to_uint32_or_null(string? value)
Parameters
valuestring
Returns
- uint?
to_uint32<TValue>(TValue?)
toUInt32(value): converts a numeric or textual value to the vendor UInt32. Numeric narrowing wraps modulo the target width, and a float is truncated toward zero; an unparsable string raises CANNOT_PARSE_TEXT and an empty string raises ATTEMPT_TO_READ_AFTER_EOF. A null input yields null. Requires a provider that supports it (ClickHouse).
public uint? to_uint32<TValue>(TValue? value)
Parameters
valueTValue
Returns
- uint?
Type Parameters
TValue
to_uint64_or_default<TValue>(TValue?)
toUInt64OrDefault(value): the vendor form that returns the UInt64 zero instead of raising on an unparsable or out-of-range value (numeric and textual inputs are accepted). A null input yields the zero, not NULL (the vendor does not propagate NULL through the fallback). Requires a provider that supports it (ClickHouse).
public ulong? to_uint64_or_default<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_uint64_or_default<TValue>(TValue?, ulong)
toUInt64OrDefault(value, defaultValue): the vendor form that returns defaultValue instead of raising. The default is rendered as toUInt64(defaultValue) so its vendor type matches the UInt64 target; a constant default outside the target range is refused at translation, while a non-constant one is converted by the server with the vendor's narrowing rule. Requires a provider that supports it (ClickHouse).
public ulong? to_uint64_or_default<TValue>(TValue? value, ulong defaultValue)
Parameters
valueTValuedefaultValueulong
Returns
Type Parameters
TValue
to_uint64_or_null(string?)
toUInt64OrNull(value): the vendor form that returns NULL instead of raising on an unparsable or out-of-range value (the vendor accepts only a String argument, so a numeric input is rejected by the server). A null input yields null. Requires a provider that supports it (ClickHouse).
public ulong? to_uint64_or_null(string? value)
Parameters
valuestring
Returns
to_uint64<TValue>(TValue?)
toUInt64(value): converts a numeric or textual value to the vendor UInt64. Numeric narrowing wraps modulo the target width, and a float is truncated toward zero; an unparsable string raises CANNOT_PARSE_TEXT and an empty string raises ATTEMPT_TO_READ_AFTER_EOF. A null input yields null. Requires a provider that supports it (ClickHouse).
public ulong? to_uint64<TValue>(TValue? value)
Parameters
valueTValue
Returns
Type Parameters
TValue
to_uint8_or_default<TValue>(TValue?)
toUInt8OrDefault(value): the vendor form that returns the UInt8 zero instead of raising on an unparsable or out-of-range value (numeric and textual inputs are accepted). A null input yields the zero, not NULL (the vendor does not propagate NULL through the fallback). Requires a provider that supports it (ClickHouse).
public byte? to_uint8_or_default<TValue>(TValue? value)
Parameters
valueTValue
Returns
- byte?
Type Parameters
TValue
to_uint8_or_default<TValue>(TValue?, byte)
toUInt8OrDefault(value, defaultValue): the vendor form that returns defaultValue instead of raising. The default is rendered as toUInt8(defaultValue) so its vendor type matches the UInt8 target; a constant default outside the target range is refused at translation, while a non-constant one is converted by the server with the vendor's narrowing rule. Requires a provider that supports it (ClickHouse).
public byte? to_uint8_or_default<TValue>(TValue? value, byte defaultValue)
Parameters
valueTValuedefaultValuebyte
Returns
- byte?
Type Parameters
TValue
to_uint8_or_null(string?)
toUInt8OrNull(value): the vendor form that returns NULL instead of raising on an unparsable or out-of-range value (the vendor accepts only a String argument, so a numeric input is rejected by the server). A null input yields null. Requires a provider that supports it (ClickHouse).
public byte? to_uint8_or_null(string? value)
Parameters
valuestring
Returns
- byte?
to_uint8<TValue>(TValue?)
toUInt8(value): converts a numeric or textual value to the vendor UInt8. Numeric narrowing wraps modulo the target width, for example -1 becomes 255, and a float is truncated toward zero; an unparsable string raises CANNOT_PARSE_TEXT and an empty string raises ATTEMPT_TO_READ_AFTER_EOF. A null input yields null. Requires a provider that supports it (ClickHouse).
public byte? to_uint8<TValue>(TValue? value)
Parameters
valueTValue
Returns
- byte?
Type Parameters
TValue
to_unix_timestamp<T>(T?)
toUnixTimestamp(value): the Unix timestamp in seconds.
public long to_unix_timestamp<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_uuid(string?)
toUUID(value): parses the textual UUID into a Guid. Upper-case input is
accepted; a malformed string raises the server's CANNOT_PARSE_UUID error. A
null input yields null. Requires a provider that
supports it (ClickHouse).
public Guid? to_uuid(string? value)
Parameters
valuestring
Returns
- Guid?
to_uuid_or_default(string?, Guid)
toUUIDOrDefault(value, defaultValue): the parsed Guid, or
defaultValue when the string cannot be parsed or is
null. Requires a provider that supports it (ClickHouse).
public Guid? to_uuid_or_default(string? value, Guid defaultValue)
Parameters
Returns
- Guid?
to_uuid_or_null(string?)
toUUIDOrNull(value): the parsed Guid, or null when
the string cannot be parsed or is null; unlike
to_uuid(string?) a malformed value is not an error. Requires a provider that
supports it (ClickHouse).
public Guid? to_uuid_or_null(string? value)
Parameters
valuestring
Returns
- Guid?
to_week(DateTime)
toWeek(value): the week number in mode 0 (weeks start on Sunday, range 0..53, the
first week is the one containing a Sunday of this year). The server returns UInt8,
surfaced as int. Requires a provider that supports it (ClickHouse); every
other provider and the in-memory provider reject the call.
public int to_week(DateTime value)
Parameters
valueDateTime
Returns
to_week(DateTime, int)
toWeek(value, mode): the week number under one of the vendor's ten modes
(0..9, the MySQL WEEK() table: mode 0/1 range 0..53, 2..9 range 1..53; even
modes start on Sunday, odd modes on Monday; mode 3 is the ISO-8601 week). A mode outside
0..9 is refused by the server and surfaced. Requires a provider that supports it
(ClickHouse); every other provider and the in-memory provider reject the call.
public int to_week(DateTime value, int mode)
Parameters
Returns
to_week(DateTime?)
The nullable form of to_week(DateTime): NULL stays NULL (Nullable(UInt8)).
public int? to_week(DateTime? value)
Parameters
valueDateTime?
Returns
- int?
to_week(DateTime?, int?)
The nullable form of to_week(DateTime, int): NULL stays NULL.
public int? to_week(DateTime? value, int? mode)
Parameters
Returns
- int?
to_year_week(DateTime)
toYearWeek(value): the combined year and week (year * 100 + week) in mode 0.
Unlike to_week(DateTime) the year component follows the week into the
neighbouring year, so toYearWeek(2023-12-31) is 202353 while
toWeek(2023-12-31) is 53. The server returns UInt32, lowered to
int. Requires a provider that supports it (ClickHouse); every other provider
and the in-memory provider reject the call.
public int to_year_week(DateTime value)
Parameters
valueDateTime
Returns
to_year_week(DateTime, int)
toYearWeek(value, mode): the combined year and week under the toWeek modes
0..9. Requires a provider that supports it (ClickHouse); every other provider and
the in-memory provider reject the call.
public int to_year_week(DateTime value, int mode)
Parameters
Returns
to_year_week(DateTime?)
The nullable form of to_year_week(DateTime): NULL stays NULL (Nullable(UInt32)).
public int? to_year_week(DateTime? value)
Parameters
valueDateTime?
Returns
- int?
to_year_week(DateTime?, int?)
The nullable form of to_year_week(DateTime, int): NULL stays NULL.
public int? to_year_week(DateTime? value, int? mode)
Parameters
Returns
- int?
to_year<T>(T?)
toYear(value): the year part.
public int to_year<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_yyyymm<T>(T?)
toYYYYMM(value): the year and month packed as a YYYYMM integer.
public int to_yyyymm<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_yyyymmdd<T>(T?)
toYYYYMMDD(value): the date packed as a YYYYMMDD integer.
public int to_yyyymmdd<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
today()
today(): the current date in the server time zone.
public DateTime? today()
Returns
top_k_weighted<T, TWeight>(long, T?, TWeight?)
topKWeighted(k)(value, weight): the values with the largest approximate sum of
weight, surfaced as T[]. Requires a provider that supports it (see
TopKAggregates; ClickHouse). The result is approximate.
public T[] top_k_weighted<T, TWeight>(long k, T? value, TWeight? weight)
Parameters
klongvalueTweightTWeight
Returns
- T[]
Type Parameters
TTWeight
top_k<T>(long, T?)
topK(k)(value): the approximately most frequent values, sorted by descending
approximate frequency. The native result is Array(T), surfaced as T[] and
projected directly (or used as the operand of an array function such as
array_sort<T>(T[])). Requires a provider that supports it (see
TopKAggregates; ClickHouse). The result is approximate.
public T[] top_k<T>(long k, T? value)
Parameters
klongvalueT
Returns
- T[]
Type Parameters
T
top_level_domain(string?)
topLevelDomain(url): the last label of the host name (for example com), with or
without a scheme. An unparsable value, a trailing-dot host and an address-only host yield an
empty string. A null input yields null. Requires a
provider that supports it (ClickHouse).
public string? top_level_domain(string? url)
Parameters
urlstring
Returns
trim_both(string?, string?)
trimBoth(value[, characters]): as trim_left(string?, string?) from both ends.
public string? trim_both(string? value, string? characters = null)
Parameters
Returns
trim_left(string?, string?)
trimLeft(value) or trimLeft(value, characters): removes the leading whitespace,
or every leading character contained in characters. Requires a provider
that supports it (ClickHouse).
public string? trim_left(string? value, string? characters = null)
Parameters
Returns
trim_right(string?, string?)
trimRight(value[, characters]): as trim_left(string?, string?) from the end.
public string? trim_right(string? value, string? characters = null)
Parameters
Returns
tuple_concat<T1, T2, T3, T4>(Tuple<T1, T2>, Tuple<T3, T4>)
tupleConcat(first, second): the elements of both tuples, concatenated. The two- and
three-component forms cover the documented arities that a typed CLR tuple can name; the
result is cast to the declared Tuple<T1, T2, T3, T4> so the element types match.
Requires a provider that supports the ClickHouse tuple surface.
public Tuple<T1, T2, T3, T4> tuple_concat<T1, T2, T3, T4>(Tuple<T1, T2> first, Tuple<T3, T4> second)
Parameters
Returns
- Tuple<T1, T2, T3, T4>
Type Parameters
T1T2T3T4
tuple_concat<T1, T2, T3, T4, T5, T6>(Tuple<T1, T2, T3>, Tuple<T4, T5, T6>)
tupleConcat(first, second): the elements of both tuples, concatenated. The two- and
three-component forms cover the documented arities that a typed CLR tuple can name; the
result is cast to the declared Tuple<T1, T2, T3, T4> so the element types match.
Requires a provider that supports the ClickHouse tuple surface.
public Tuple<T1, T2, T3, T4, T5, T6> tuple_concat<T1, T2, T3, T4, T5, T6>(Tuple<T1, T2, T3> first, Tuple<T4, T5, T6> second)
Parameters
Returns
- Tuple<T1, T2, T3, T4, T5, T6>
Type Parameters
T1T2T3T4T5T6
tuple_divide<T1, T2>(Tuple<T1, T2>, Tuple<T1, T2>)
tupleDivide (the tuple/ operator): the element-wise quotient, always
Float64 regardless of the component types (verified on 25.8: Int32 / Int32 is
Float64), cast to the declared Tuple<T1, T2> of doubles. Division by zero
yields the IEEE inf/nan, never an exception. Numeric components only.
public Tuple<double, double> tuple_divide<T1, T2>(Tuple<T1, T2> first, Tuple<T1, T2> second)
Parameters
Returns
Type Parameters
T1T2
tuple_hamming_distance<T1, T2>(Tuple<T1, T2>, Tuple<T1, T2>)
tupleHammingDistance(first, second): the number of positions at which the two tuples
differ, as long (the native result is UInt8/16/32/64 by arity and is lowered through
toInt64). Elements are compared for equality, so any component type the server can
compare is accepted (strings included); both tuples must have the same arity, which the
signature enforces.
public long tuple_hamming_distance<T1, T2>(Tuple<T1, T2> first, Tuple<T1, T2> second)
Parameters
Returns
Type Parameters
T1T2
tuple_hamming_distance<T1, T2, T3>(Tuple<T1, T2, T3>, Tuple<T1, T2, T3>)
tupleHammingDistance(first, second): the number of positions at which the two tuples
differ, as long (the native result is UInt8/16/32/64 by arity and is lowered through
toInt64). Elements are compared for equality, so any component type the server can
compare is accepted (strings included); both tuples must have the same arity, which the
signature enforces.
public long tuple_hamming_distance<T1, T2, T3>(Tuple<T1, T2, T3> first, Tuple<T1, T2, T3> second)
Parameters
Returns
Type Parameters
T1T2T3
tuple_minus<T1, T2>(Tuple<T1, T2>, Tuple<T1, T2>)
tupleMinus (the tuple- operator): the element-wise difference, with the same component-type and cast rules as tuple_plus<T1, T2>(Tuple<T1, T2>, Tuple<T1, T2>).
public Tuple<T1, T2> tuple_minus<T1, T2>(Tuple<T1, T2> first, Tuple<T1, T2> second)
Parameters
Returns
- Tuple<T1, T2>
Type Parameters
T1T2
tuple_multiply<T1, T2>(Tuple<T1, T2>, Tuple<T1, T2>)
tupleMultiply (the tuple* operator): the element-wise product, with the same component-type and cast rules as tuple_plus<T1, T2>(Tuple<T1, T2>, Tuple<T1, T2>).
public Tuple<T1, T2> tuple_multiply<T1, T2>(Tuple<T1, T2> first, Tuple<T1, T2> second)
Parameters
Returns
- Tuple<T1, T2>
Type Parameters
T1T2
tuple_names<T1, T2>(Tuple<T1, T2>)
tupleNames(tuple): the element names of a named tuple as a String array. For
an unnamed tuple the server substitutes the one-based indices as strings (verified on
25.8: tupleNames(tuple(1, 2)) is ['1', '2']). The result is
Array(String) and never depends on the element types.
public string[] tuple_names<T1, T2>(Tuple<T1, T2> tuple)
Parameters
tupleTuple<T1, T2>
Returns
- string[]
Type Parameters
T1T2
tuple_names<T1, T2, T3>(Tuple<T1, T2, T3>)
tupleNames(tuple): the element names of a named tuple as a String array. For
an unnamed tuple the server substitutes the one-based indices as strings (verified on
25.8: tupleNames(tuple(1, 2)) is ['1', '2']). The result is
Array(String) and never depends on the element types.
public string[] tuple_names<T1, T2, T3>(Tuple<T1, T2, T3> tuple)
Parameters
tupleTuple<T1, T2, T3>
Returns
- string[]
Type Parameters
T1T2T3
tuple_plus<T1, T2>(Tuple<T1, T2>, Tuple<T1, T2>)
tuplePlus(first, second) (the tuple+ operator): the element-wise sum of the
two tuples, cast to the declared component types. ClickHouse widens integral components
(Int32 + Int32 is computed as Int64), so the cast is what keeps the declared
Tuple<T1, T2> exact; a value outside the declared component type wraps on
the server cast exactly as the ClickHouse Int32 cast does. Numeric components only:
a string or decimal component is refused at translation.
public Tuple<T1, T2> tuple_plus<T1, T2>(Tuple<T1, T2> first, Tuple<T1, T2> second)
Parameters
Returns
- Tuple<T1, T2>
Type Parameters
T1T2
tuple_to_name_value_pairs<T1, T2>(Tuple<T1, T2>)
tupleToNameValuePairs(tuple): the tuple as (name, value) pairs. The server
requires every tuple element to have the same type (a heterogeneous tuple raises
Code 43 on 25.8), so the declared T1 and T2
must be identical after type inference; a heterogeneous tuple is refused at translation
with that precise reason instead of an untyped object[] shape. The pair name is the
element name for a named tuple and the one-based index string for an unnamed tuple.
public Tuple<string, T1>[] tuple_to_name_value_pairs<T1, T2>(Tuple<T1, T2> tuple)
Parameters
tupleTuple<T1, T2>
Returns
Type Parameters
T1T2
tuple_to_name_value_pairs<T1, T2, T3>(Tuple<T1, T2, T3>)
tupleToNameValuePairs(tuple): the tuple as (name, value) pairs. The server
requires every tuple element to have the same type (a heterogeneous tuple raises
Code 43 on 25.8), so the declared T1 and T2
must be identical after type inference; a heterogeneous tuple is refused at translation
with that precise reason instead of an untyped object[] shape. The pair name is the
element name for a named tuple and the one-based index string for an unnamed tuple.
public Tuple<string, T1>[] tuple_to_name_value_pairs<T1, T2, T3>(Tuple<T1, T2, T3> tuple)
Parameters
tupleTuple<T1, T2, T3>
Returns
Type Parameters
T1T2T3
ulid_string_to_datetime(string?)
ULIDStringToDateTime(value): the millisecond timestamp component of the 26-character
Crockford Base32 ULID as DateTime64(3); either case is accepted and the nil ULID
decodes to the epoch. A value that is not 26 characters raises the server's
ILLEGAL_COLUMN error. The 48-bit ULID timestamp range reaches year 10889, beyond
the DateTime64(3) range: such values saturate server-side and cannot be
materialized as DateTime, so the driver raises instead of returning a wrong
instant. A null input yields null. Requires a provider
that supports it (ClickHouse).
public DateTime? ulid_string_to_datetime(string? value)
Parameters
valuestring
Returns
unbin(string?)
unbin(bits): the inverse of bin(ulong?). The server returns the decoded
value as a binary string (a BLOB), so the member surfaces those bytes as an upper-case
hexadecimal string rather than as a CLR string that would decode arbitrary bytes as UTF-8:
unbin(bin(42)) is '2A'. The bits are consumed from the right, an odd-length
input is left-padded with a zero, and the server does not reject characters other than
'0'/'1'. A null input yields null and an
empty input yields the empty string. Requires a provider that supports it (ClickHouse).
public string? unbin(string? bits)
Parameters
bitsstring
Returns
unhex(string?)
unhex(value): the string whose UTF-8 bytes are the hexadecimal digits of
value; an odd number of digits is left-padded with a zero. The server does
not validate the digits, so only hex-produced text round-trips. An empty input yields the
empty string and a null input yields null. Requires a
provider that supports it (ClickHouse).
public string? unhex(string? value)
Parameters
valuestring
Returns
uniq_combined<T>(T?)
uniqCombined(value): the approximate distinct count (combined algorithm).
public long uniq_combined<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
uniq_exact<T>(T?)
uniqExact(value): the exact number of distinct values.
public long uniq_exact<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
uniq_hll12<T>(T?)
uniqHLL12(value): the approximate distinct count using HLL(12).
public long uniq_hll12<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
uniq_up_to<T>(long, T?)
uniqUpTo(N)(value): the exact distinct count while it is at most n,
otherwise N + 1 (the maximum accepted N is 100). The native UInt64 is lowered
with toInt64. Requires ClickHouseAggregates (ClickHouse).
public long uniq_up_to<T>(long n, T? value)
Parameters
nlongvalueT
Returns
Type Parameters
T
uniq<T>(T?)
uniq(value): the approximate number of distinct values. Requires a provider that
supports the distinct-count family (see UniqAggregates; ClickHouse).
public long uniq<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
untuple<T1, T2>(Tuple<T1, T2>)
untuple(tuple) is a documented deterministic refusal. The function performs a
syntactic substitution of the tuple elements in the call location: one projected
expression becomes a dynamic set of columns whose count and types follow the tuple and
whose names the vendor declares implementation-specific. NextORM maps one projection
expression to exactly one result column, so no CLR return type can name or declare that
shape; the declared object is never materialized and the translation raises
NotSupportedException with this reason before any SQL is emitted. Project the
components explicitly (tuple.Item1/tuple.Item2) instead.
public object? untuple<T1, T2>(Tuple<T1, T2> tuple)
Parameters
tupleTuple<T1, T2>
Returns
Type Parameters
T1T2
upper_utf8(string?)
upperUTF8(value): uppercases character-wise (UTF-8 aware).
public string? upper_utf8(string? value)
Parameters
valuestring
Returns
url_hash(string?)
URLHash(value): the normalized URL hash as the server's unsigned UInt64. One
trailing /, ? or # is ignored, as the vendor defines. A
null input yields null.
public ulong? url_hash(string? value)
Parameters
valuestring
Returns
url_hash(string?, byte)
URLHash(value, level): the hash of the URL truncated to the given hierarchy level
(0 is the whole URL), rendered as toUInt8(level) because the vendor level parameter
is a UInt8. A null input yields null.
public ulong? url_hash(string? value, byte level)
Parameters
Returns
url_hierarchy(string)
URLHierarchy(url): the progressively longer URLs of a value, truncated at /,
? and # (https://x/a/b?c=1 yields four elements). The server returns
Array(String); the argument cannot be Nullable (an Array cannot be inside a
Nullable type), hence the non-nullable parameter. Requires a provider that supports it
(ClickHouse).
public string[] url_hierarchy(string url)
Parameters
urlstring
Returns
- string[]
url_path_hierarchy(string)
URLPathHierarchy(url): the path-only hierarchy of a URL, without the protocol and host
(https://x/a/b?c=1 yields /a/, /a/b?, /a/b?c=1). The argument
cannot be Nullable, hence the non-nullable parameter. Requires a provider that supports
it (ClickHouse).
public string[] url_path_hierarchy(string url)
Parameters
urlstring
Returns
- string[]
url<TRow>(string, string, string)
url(url, format, structure) as a FROM source: reads the resource at
url in format with the column layout
structure (for example 'id UInt64, name String'). The row shape is
declared by the caller through TRow, whose [Column] names must
match structure. Requires a provider that supports table functions (see
SupportsTableFunction(string); ClickHouse). Use through
ctx.From(() => ...).
The URL selects the backend: an HTTP(S) URL is fetched directly, a recognised non-HTTP
scheme (file://, s3://, …) is delegated to the matching function.
public TvfEntityBuilder<TRow> url<TRow>(string url, string format, string structure)
Parameters
Returns
- TvfEntityBuilder<TRow>
Type Parameters
TRow
uuid_num_to_string(string?)
UUIDNumToString(num): the lower-case hyphenated textual UUID of the 16-byte binary
value given as 32 hexadecimal digits — the form uuid_string_to_num(string?)
returns, so the pair round-trips:
uuid_num_to_string(uuid_string_to_num(s)) is s. A shorter input is padded
with zero bytes by the server's toFixedString; a longer one raises
TOO_LARGE_STRING_SIZE. A null input yields null.
Requires a provider that supports it (ClickHouse).
public string? uuid_num_to_string(string? num)
Parameters
numstring
Returns
uuid_string_to_num(string?)
UUIDStringToNum(value): the 16-byte binary UUID as 32 upper-case hexadecimal
digits in textual (big-endian) order, the vendor default variant. The server returns
sixteen zero bytes for a string it cannot parse, so malformed input is a deterministic
value rather than an exception. A null input yields
null. Requires a provider that supports it (ClickHouse).
public string? uuid_string_to_num(string? value)
Parameters
valuestring
Returns
uuid_to_num(Guid?)
UUIDToNum(value): the binary form of a Guid as 32 upper-case
hexadecimal digits (textual/big-endian order, the vendor default variant). A
null input yields null. Requires a provider that
supports it (ClickHouse).
public string? uuid_to_num(Guid? value)
Parameters
valueGuid?
Returns
uuid_v7_to_datetime(Guid?)
UUIDv7ToDateTime(value): the millisecond timestamp component of a version-7 UUID as
DateTime64(3). The vendor does not validate the version: it decodes the first 48
bits, so the nil UUID and a non-v7 value decode to the epoch (1970-01-01) instead of
raising. A null input yields null. Requires a provider
that supports it (ClickHouse).
public DateTime? uuid_v7_to_datetime(Guid? value)
Parameters
valueGuid?
Returns
values<TRow>(string)
values(structure, values...) as a FROM source: a temporary table whose result schema is
derived from TRow. The structure string (for example
'a UInt8, b String') is rendered from TRow's mapped properties
and types; tuples is the verbatim row list, for example
"(1, 'x'), (2, 'y')", emitted after it. Only trusted developer-authored SQL may be
passed as tuples. Requires a provider that supports a typed result schema
(see SupportsResultSchema(TableFunctionSchema); ClickHouse). Use through
ctx.From(() => ...).
public TvfEntityBuilder<TRow> values<TRow>(string tuples)
Parameters
tuplesstringThe verbatim tuple list, for example
"(1, 'x'), (2, 'y')".
Returns
- TvfEntityBuilder<TRow>
Type Parameters
TRowThe caller-declared row shape; its
[Column]names/types form the structure.
visit_param_extract_bool(string?, string?)
visitParamExtractBool(json, name): the boolean of the flat name key.
public bool visit_param_extract_bool(string? json, string? name)
Parameters
Returns
visit_param_extract_float(string?, string?)
visitParamExtractFloat(json, name): the double of the flat name key.
public double visit_param_extract_float(string? json, string? name)
Parameters
Returns
visit_param_extract_int(string?, string?)
visitParamExtractInt(json, name): the 64-bit integer of the flat name key.
public long visit_param_extract_int(string? json, string? name)
Parameters
Returns
visit_param_extract_raw(string?, string?)
visitParamExtractRaw(json, name): the raw fragment of the flat name key.
public string? visit_param_extract_raw(string? json, string? name)
Parameters
Returns
visit_param_extract_string(string?, string?)
visitParamExtractString(json, name): the string value of the flat name
key. Requires a provider that supports the string-JSON family (see
SupportsJsonExtract; ClickHouse).
public string? visit_param_extract_string(string? json, string? name)
Parameters
Returns
welch_t_test<TData, TIndex>(TData?, TIndex?)
welchTTest(sample_data, sample_index): Welch's t-test over the two populations
encoded by sampleIndex (0 = first population, otherwise the second),
surfaced as Tuple(t_statistic, p_value). Requires
ClickHouseAggregates (ClickHouse).
public Tuple<double, double> welch_t_test<TData, TIndex>(TData? sampleData, TIndex? sampleIndex)
Parameters
sampleDataTDatasampleIndexTIndex
Returns
Type Parameters
TDataTIndex
when<T>(bool, T?)
A multiIf branch: when condition is true, the result is
value. Requires a provider that supports multiIf (see
MultiIf; ClickHouse).
public ClickHouseFunctions.MultiIfBranch<T> when<T>(bool condition, T? value)
Parameters
conditionboolvalueT
Returns
Type Parameters
T
window_funnel<TTime>(long, TTime?, params bool[])
windowFunnel(window)(timestamp, cond1, cond2, ...): the maximum number of consecutive
conditions satisfied within the sliding window (in units of
timestamp). Requires a provider that supports it (see
SequenceAggregates; ClickHouse). The conditions must be
inline expressions; a captured condition array is rejected.
public int window_funnel<TTime>(long window, TTime? timestamp, params bool[] conditions)
Parameters
Returns
Type Parameters
TTime
word_shingle_min_hash(string?, byte?)
wordShingleMinHash(value[, shinglesize]): the minimum and maximum of the word-shingle
hashes as the declared Tuple<T1, T2> of two unsigned 64-bit hashes.
shinglesize is a UInt8 from 1 to 25 (vendor default 3); the vendor
hashnum is fixed at its default 6 for the same arity reason as
ngram_min_hash_arg(string?, byte?). A nullable argument column is rejected by the server
(a Tuple cannot be inside Nullable).
public Tuple<ulong, ulong> word_shingle_min_hash(string? value, byte? shinglesize = null)
Parameters
Returns
word_shingle_min_hash_arg(string?, byte?)
wordShingleMinHashArg(value[, shinglesize]): the word shingles with the minimum and
maximum hashes as two six-component string tuples (the vendor hashnum = 6 arity).
Short inputs are padded with empty strings. A nullable argument column is rejected by the
server (a Tuple cannot be inside Nullable).
public Tuple<Tuple<string, string, string, string, string, string>, Tuple<string, string, string, string, string, string>> word_shingle_min_hash_arg(string? value, byte? shinglesize = null)
Parameters
Returns
- Tuple<Tuple<string, string, string, string, string, string>, Tuple<string, string, string, string, string, string>>
word_shingle_sim_hash(string?, byte?)
wordShingleSimHash(value[, shinglesize]): the word-shingle SimHash as the server's
unsigned UInt64. shinglesize is a UInt8 from 1 to 25
(vendor default 3). A null input yields null.
public ulong? word_shingle_sim_hash(string? value, byte? shinglesize = null)
Parameters
Returns
word_shingle_sim_hash_arg(string?, byte?)
wordShingleSimHashArg(value[, shinglesize]): refused for the same documented reason
as ngram_sim_hash_arg(string?, byte?) — the vendor defines no arg-returning word-shingle
SimHash sibling (wordShingleMinHashArg is the only Arg form), so the expansion member
names a function that exists in no ClickHouse version and fails with
UNKNOWN_FUNCTION.
public Tuple<Tuple<string, string, string, string, string, string>, Tuple<string, string, string, string, string, string>> word_shingle_sim_hash_arg(string? value, byte? shinglesize = null)
Parameters
Returns
- Tuple<Tuple<string, string, string, string, string, string>, Tuple<string, string, string, string, string, string>>
wy_hash64(string?)
public ulong? wy_hash64(string? value)
Parameters
valuestring
Returns
xx_hash32(string?)
xxHash32(value): the 32-bit xxHash as a signed integer. Requires a provider that supports it (ClickHouse).
public int xx_hash32(string? value)
Parameters
valuestring
Returns
xx_hash64(string?)
xxHash64(value): the 64-bit xxHash as a signed integer.
public long xx_hash64(string? value)
Parameters
valuestring
Returns
xxh3(string?)
xxh3(value): the 64-bit XXH3 hash as a signed integer.
public long xxh3(string? value)
Parameters
valuestring
Returns
yesterday()
yesterday(): the date one day before today().
public DateTime? yesterday()
Returns
zeros(long)
zeros(count) as a FROM source; select Value. Yields
count rows whose single zero UInt8 column is 0. Requires a
provider that supports table functions (see SupportsTableFunction(string);
ClickHouse). Use through
ctx.From(() => ...).
public TvfEntityBuilder<SqlFunctions.IZerosRow> zeros(long count)
Parameters
countlong
Returns
zeros_mt(long)
zeros_mt(count) as a FROM source: as zeros(long) but evaluated with
multiple threads.
public TvfEntityBuilder<SqlFunctions.IZerosRow> zeros_mt(long count)
Parameters
countlong