-State 的聚合函数 groupBitmap 进行构造,另一种是从 Array 对象构造 bitmap。
bitmapAnd
bitmap1— 第一个 bitmap 对象。AggregateFunction(groupBitmap, T)。 -bitmap2— 第二个 bitmap 对象。AggregateFunction(groupBitmap, T)。
AggregateFunction(groupBitmap, T)
示例
使用示例
Query
Response
bitmapAndCardinality
bitmap1— 第一个 bitmap 对象。AggregateFunction(groupBitmap, T)。 -bitmap2— 第二个 bitmap 对象。AggregateFunction(groupBitmap, T)。
UInt64
示例
用法示例
Query
Response
bitmapAndnot
bitmap1— 第一个 bitmap 对象。AggregateFunction(groupBitmap, T)。 -bitmap2— 第二个 bitmap 对象。AggregateFunction(groupBitmap, T)。
AggregateFunction(groupBitmap, T)
示例
使用示例
Query
Response
bitmapAndnotCardinality
bitmap1— 第一个 bitmap 对象。AggregateFunction(groupBitmap, T)。-bitmap2— 第二个 bitmap 对象。AggregateFunction(groupBitmap, T)。
bitmap1 AND-NOT bitmap2 结果中置位的位数。UInt64
示例
使用示例
Query
Response
bitmapBuild
bitmapToArray 的逆操作。
语法
array— 整数数组。Array((U)Int*)
AggregateFunction(groupBitmap, T)
示例
用法示例
Query
Response
Query
Response
bitmapCardinality
bitmap— bitmap 对象。AggregateFunction(groupBitmap, T)。
UInt64
示例
使用示例
Query
Response
bitmapContains
Int8 值 -1 匹配 255) 。
语法
bitmap— bitmap 对象。AggregateFunction(groupBitmap, T)。-value— 待检查的元素。(U)Int8/16/32/64
1,否则返回 0。UInt8
示例
使用示例
Query
Response
Query
Response
bitmapHasAll
bitmap1— 第一个 bitmap 对象。AggregateFunction(groupBitmap, T)。 -bitmap2— 第二个 bitmap 对象。AggregateFunction(groupBitmap, T)。
1,否则返回 0。UInt8
示例
用法示例
Query
Response
bitmapHasAny
bitmap1— 第一个 bitmap 对象。AggregateFunction(groupBitmap, T)。 -bitmap2— 第二个 bitmap 对象。AggregateFunction(groupBitmap, T)。
1;否则返回 0。UInt8
示例
使用示例
Query
Response
bitmapMax
Int8 值 -1 为 255) 。如果 bitmap 为空,则返回 0。
语法
bitmap— bitmap 对象。AggregateFunction(groupBitmap, T)。
0 UInt64
示例
使用示例
Query
Response
Query
Response
bitmapMin
Int8 值 -128 视为 128) 。如果 bitmap 为空,则返回 UINT32_MAX (如果 bitmap 元素类型宽于 32 位,则返回 UINT64_MAX) 。
语法
bitmap— bitmap 对象。AggregateFunction(groupBitmap, T)。
UINT32_MAX/UINT64_MAX UInt64
示例
用法示例
Query
Response
Query
Response
bitmapOr
bitmap1— 第一个 bitmap 对象。AggregateFunction(groupBitmap, T)。 -bitmap2— 第二个 bitmap 对象。AggregateFunction(groupBitmap, T)。
AggregateFunction(groupBitmap, T)
示例
使用示例
Query
Response
bitmapOrCardinality
bitmap1— 第一个 bitmap 对象。AggregateFunction(groupBitmap, T)。 -bitmap2— 第二个 bitmap 对象。AggregateFunction(groupBitmap, T)。
UInt64
示例
用法示例
Query
Response
bitmapSubsetInRange
[start, end) 内的元素。元素值按 bitmap 元素类型的无符号整数进行比较。
语法
bitmap— 要从中提取 子集 的 bitmap。AggregateFunction(groupBitmap, T)。-start— 范围的起始位置 (含) 。UInt*-end— 值范围的结束位置 (不含) 。UInt*
AggregateFunction(groupBitmap, T)
示例
使用示例
Query
Response
bitmapSubsetLimit
cardinality_limit 个元素的子集,其中元素值大于或等于 range_start,并按无符号顺序选取其中最小的值。
语法
bitmap— bitmap 对象。AggregateFunction(groupBitmap, T)。-range_start— 范围的起始值 (含) 。UInt32-cardinality_limit— 子集的最大基数。UInt32
cardinality_limit 个无符号值不小于 range_start 的元素。AggregateFunction(groupBitmap, T)
示例
使用示例
Query
Response
bitmapToArray
T 一致 (有符号或无符号整数) 。它是函数 bitmapBuild 的逆操作。
语法
bitmap— 要转换的 bitmap。AggregateFunction(groupBitmap, T)。
Array(T)
示例
使用示例
Query
Response
Query
Response
bitmapTransform
from_array 到 to_array 的映射替换 bitmap 中的元素。
值会被解释为 bitmap 元素类型的无符号整数 (与 bitmapContains 位于同一值域) 。
对于有符号 bitmap,负元素会与其对应的无符号值匹配 (例如,Int8 值 -1 与 255 匹配) 。
to_array 中不适合 bitmap 元素类型的值会引发 BAD_ARGUMENTS。from_array 中
不适合该类型的值不会被找到,因此不会应用相应的替换。
语法
bitmap— bitmap 对象。AggregateFunction(groupBitmap, T)。-from_array— 要替换的原始置位组成的 Array。Array(T)。-to_array— 用于替换的新置位组成的 Array。Array(T)。
AggregateFunction(groupBitmap, T)
示例
用法示例
Query
Response
Query
Response
bitmapXor
bitmap1— 第一个 bitmap 对象。AggregateFunction(groupBitmap, T)。 -bitmap2— 第二个 bitmap 对象。AggregateFunction(groupBitmap, T)。
AggregateFunction(groupBitmap, T)
示例
使用示例
Query
Response
bitmapXorCardinality
bitmap1— 第一个 bitmap 对象。AggregateFunction(groupBitmap, T)。-bitmap2— 第二个 bitmap 对象。AggregateFunction(groupBitmap, T)。
UInt64
示例
使用示例
Query
Response
subBitmap
offset 个元素后,返回 bitmap 的一个子集。返回的 bitmap 的最大基数为 cardinality_limit。
语法
bitmap— Bitmap 对象。AggregateFunction(groupBitmap, T). -offset— 从开头要跳过的置位数量 (从零开始计数) 。UInt32-cardinality_limit— 子集中最多包含的置位数量。UInt32
offset 个元素后,最多包含 cardinality_limit 个元素。AggregateFunction(groupBitmap, T)
示例
使用示例
Query
Response