📄️ base64_to_bitmap
Before you import bitmap data into StarRocks, you need to serialize the data and encode the data as a Base64 string. When you import the Base64 string into StarRocks, you need to convert the string into bitmap data.
📄️ bitmap_agg
Aggregates values (excluding NULLs) in a column into a bitmap (multiple rows into one row).
📄️ bitmap_and
Calculates the intersection of two input bitmaps and returns the new bitmap.
📄️ bitmap_andnot
Returns bitmap values that exist in lhs but do not exist in rhs, and returns the new bitmap.
📄️ bitmap_contains
Calculates whether the input value is in the bitmap column, and returns a Boolean value.
📄️ bitmap_count
Returns the 1-bit count for the input bitmap.
📄️ bitmap_empty
Returns an empty bitmap. It is mainly used to fill in the default value during insert or stream load. For example:
📄️ bitmap_from_binary
Converts a binary string with a specific format to a bitmap.
📄️ bitmap_from_string
Converts a string into a BITMAP. The string is composed of a set of UINT64 numbers separated by commas. For example, the "0, 1, 2" string will be converted into a Bitmap, in which bits 0, 1 and 2 are set. If the input field is invalid, NULL will be returned.
📄️ bitmap_has_any
Calculates whether there are intersecting elements between two Bitmap columns, and the return value is Boolean value.
📄️ bitmap_hash
Calculates a 32-bit hash value for any type of input and return the bitmap containing the hash value. It is mainly used for the stream load task to import non integer fields into the bitmap field of the StarRocks table. For example:
📄️ bitmap_intersect
Aggregation function, used to calculate the bitmap intersection after grouping. Common usage scenarios, such as calculating user retention rate.
📄️ bitmap_max
Obtains the maximum value of a bitmap. If the bitmap is NULL, this function returns NULL. If the bitmap is empty, this function returns NULL by default.
📄️ bitmap_min
Obtains the minimum value of a bitmap. If the bitmap is NULL, this function returns NULL. If the bitmap is empty, this function returns NULL by default.
📄️ bitmap_or
Calculates the union of two input bitmaps and return a new bitmap.
📄️ bitmap_remove
Removes input from the Bitmap value lhs and returns a result set.
📄️ bitmap_subset_in_range
Intercepts elements from a Bitmap value within the range of startrange and endrange (exclusive). The output elements are a subset of the Bitmap value.
📄️ bitmap_subset_limit
Intercepts a specified number of elements from a BITMAP value with element value starting from start range. The output elements are a subset of src.
📄️ bitmap_to_array
Converts a BITMAP into a BIGINT array.
📄️ bitmap_to_base64
Converts a bitmap to a Base64-encoded string. This function is supported from v2.5.
📄️ bitmap_to_binary
Converts Bitmap values to a Binary string.
📄️ bitmap_to_string
Converts an input bitmap into a string that is separated by commas (,). This string contains all the bits in the bitmap. If the input is null, null is returned.
📄️ bitmap_union
Calculates the bitmap union of a set of values after grouping. Common usage scenarios include calculating PV and UV.
📄️ bitmap_union_count
Returns the union of a set of bitmap values and returns the cardinality of the union. This function is supported from v2.3.
📄️ bitmap_union_int
Count the number of different values in columns of type TINYINT, SMALLINT and INT, return the sum of COUNT (DISTINCT expr) same.
📄️ bitmap_xor
Calculates the set consisting elements unique to lhs and rhs. It is logically equivalent to bitmapandnot(bitmapor(lhs, rhs), bitmap_and(lhs, rhs)) (complementary set).
📄️ intersect_count
A function to find the intersection size (number of same elements) of two Bitmap values, without requiring the data distribution to be orthogonal. The first parameter is the Bitmap column, the second parameter is the dimension column used for filtering, and the third parameter is a variable-length parameter, meaning that different values of the filtering dimension column are taken.
📄️ sub_bitmap
Intercepts len elements from a BITMAP value src starting from the position specified by offset. The output elements are a subset of src.
📄️ subdivide_bitmap
Splits a large bitmap into multiple sub-bitmaps.
📄️ to_bitmap
The input is unsigned bigint with the value ranging from 0 to 18446744073709551615, and the output is bitmap containing this element. This function is mainly used for the stream load task to import integer fields into the bitmap field of the StarRocks table. For example:
📄️ unnest_bitmap
unnest_bitmap is a table function that takes a bitmap and converts elements in that bitmap into multiple rows of a table.