Documentation Index
Fetch the complete documentation index at: https://private-7c7dfe99-page-updates.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Bitmap functions
Bitmaps can be constructed in two ways. The first way is constructed by aggregation function groupBitmap with-State, the other way is to constructed a bitmap from an Array object.
bitmapAnd
Introduced in: v20.1.0 Computes the logical conjunction (AND) of two bitmaps. Syntaxbitmap1— First bitmap object.AggregateFunction(groupBitmap, T). -bitmap2— Second bitmap object.AggregateFunction(groupBitmap, T).
AggregateFunction(groupBitmap, T)
Examples
Usage example
Query
Response
bitmapAndCardinality
Introduced in: v20.1.0 Returns the cardinality of the logical conjunction (AND) of two bitmaps. Syntaxbitmap1— First bitmap object.AggregateFunction(groupBitmap, T). -bitmap2— Second bitmap object.AggregateFunction(groupBitmap, T).
UInt64
Examples
Usage example
Query
Response
bitmapAndnot
Introduced in: v20.1.0 Computes the set difference A AND-NOT B of two bitmaps. Syntaxbitmap1— First bitmap object.AggregateFunction(groupBitmap, T). -bitmap2— Second bitmap object.AggregateFunction(groupBitmap, T).
AggregateFunction(groupBitmap, T)
Examples
Usage example
Query
Response
bitmapAndnotCardinality
Introduced in: v20.1.0 Returns the cardinality of the AND-NOT operation of two bitmaps. Syntaxbitmap1— First bitmap object.AggregateFunction(groupBitmap, T). -bitmap2— Second bitmap object.AggregateFunction(groupBitmap, T).
bitmap1 AND-NOT bitmap2 UInt64
Examples
Usage example
Query
Response
bitmapBuild
Introduced in: v20.1.0 Builds a bitmap from an unsigned integer array. It is the opposite of functionbitmapToArray.
Syntax
array— Unsigned integer array.Array(UInt*)
AggregateFunction(groupBitmap, T)
Examples
Usage example
Query
Response
bitmapCardinality
Introduced in: v20.1.0 Returns the number of bits set (the cardinality) in the bitmap. Syntaxbitmap— Bitmap object.AggregateFunction(groupBitmap, T).
UInt64
Examples
Usage example
Query
Response
bitmapContains
Introduced in: v20.1.0 Checks if the bitmap contains a specific element. Syntaxbitmap— Bitmap object.AggregateFunction(groupBitmap, T). -value— Element to check for. (U)Int8/16/32/64
1 if the bitmap contains the specified value, otherwise 0 UInt8
Examples
Usage example
Query
Response
bitmapHasAll
Introduced in: v20.1.0 Checks if the first bitmap contains all set bits of the second bitmap. Syntaxbitmap1— First bitmap object.AggregateFunction(groupBitmap, T). -bitmap2— Second bitmap object.AggregateFunction(groupBitmap, T).
1 if all set bits of the second bitmap are present in the first bitmap, otherwise 0 UInt8
Examples
Usage example
Query
Response
bitmapHasAny
Introduced in: v20.1.0 Checks if the first bitmap contains any set bits of the second bitmap. Syntaxbitmap1— First bitmap object.AggregateFunction(groupBitmap, T). -bitmap2— Second bitmap object.AggregateFunction(groupBitmap, T).
1 if any bits of the second bitmap are present in the first bitmap, otherwise 0 UInt8
Examples
Usage example
Query
Response
bitmapMax
Introduced in: v20.1.0 Returns the position of the greatest bit set in a bitmap, or0 if the bitmap is empty.
Syntax
bitmap— Bitmap object.AggregateFunction(groupBitmap, T).
0 UInt64
Examples
Usage example
Query
Response
bitmapMin
Introduced in: v20.1.0 Returns the position of the smallest bit set in a bitmap. If all bits are unset, orUINT32_MAX (UINT64_MAX if the bitmap contains more than 2^64 bits).
Syntax
bitmap— Bitmap object.AggregateFunction(groupBitmap, T).
UINT32_MAX/UINT64_MAX UInt64
Examples
Usage example
Query
Response
bitmapOr
Introduced in: v20.1.0 Computes the logical disjunction (OR) of two bitmaps. Syntaxbitmap1— First bitmap object.AggregateFunction(groupBitmap, T). -bitmap2— Second bitmap object.AggregateFunction(groupBitmap, T).
AggregateFunction(groupBitmap, T)
Examples
Usage example
Query
Response
bitmapOrCardinality
Introduced in: v20.1.0 Returns the cardinality of the logical disjunction (OR) of two bitmaps. Syntaxbitmap1— First bitmap object.AggregateFunction(groupBitmap, T). -bitmap2— Second bitmap object.AggregateFunction(groupBitmap, T).
UInt64
Examples
Usage example
Query
Response
bitmapSubsetInRange
Introduced in: v20.1.0 Returns a subset of the bitmap, containing only the set bits in the specified range [start, end). Uses 1-based indexing. Syntaxbitmap— Bitmap to extract the subset from.AggregateFunction(groupBitmap, T). -start— Start of the range (inclusive).UInt*-end— End of the range (exclusive).UInt*
AggregateFunction(groupBitmap, T)
Examples
Usage example
Query
Response
bitmapSubsetLimit
Introduced in: v20.1.0 Returns a subset of a bitmap from positionrange_start with at most cardinality_limit set bits. Uses 1-based indexing.
Syntax
bitmap— Bitmap object.AggregateFunction(groupBitmap, T). -range_start— Start of the range (inclusive).UInt32-cardinality_limit— Maximum cardinality of the subset.UInt32
cardinality_limit set bits, starting from range_start AggregateFunction(groupBitmap, T)
Examples
Usage example
Query
Response
bitmapToArray
Introduced in: v20.1.0 Converts a bitmap to an array of unsigned integers. It is the opposite of functionbitmapBuild.
Syntax
bitmap— Bitmap to convert.AggregateFunction(groupBitmap, T).
Array(UInt*)
Examples
Usage example
Query
Response
bitmapTransform
Introduced in: v20.1.0 Changes up to N bits in a bitmap by swapping specific bit values infrom_array with corresponding ones in to_array.
Syntax
bitmap— Bitmap object.AggregateFunction(groupBitmap, T). -from_array— Array of original set bits to be replaced.Array(T). -to_array— Array of new set bits to replace with.Array(T).
AggregateFunction(groupBitmap, T)
Examples
Usage example
Query
Response
bitmapXor
Introduced in: v20.1.0 Computes the symmetric difference (XOR) of two bitmaps. Syntaxbitmap1— First bitmap object.AggregateFunction(groupBitmap, T). -bitmap2— Second bitmap object.AggregateFunction(groupBitmap, T).
AggregateFunction(groupBitmap, T)
Examples
Usage example
Query
Response
bitmapXorCardinality
Introduced in: v20.1.0 Returns the cardinality of the XOR (symmetric difference) of two bitmaps. Syntaxbitmap1— First bitmap object.AggregateFunction(groupBitmap, T). -bitmap2— Second bitmap object.AggregateFunction(groupBitmap, T).
UInt64
Examples
Usage example
Query
Response
subBitmap
Introduced in: v21.9.0 Returns a subset of the bitmap, starting from positionoffset. The maximum cardinality of the returned bitmap is cardinality_limit.
Syntax
bitmap— Bitmap object.AggregateFunction(groupBitmap, T). -offset— Number of set bits to skip from the beginning (zero-based).UInt32-cardinality_limit— Maximum number of set bits to include in the subset.UInt32
limit set bits, starting after skipping offset set bits in ascending order AggregateFunction(groupBitmap, T)
Examples
Usage example
Query
Response