GROPU_BITMAP_AND_STATE
Introduction
The GROPU_BITMAP_AND_STATE
function is used to compute the bitwise AND operation on a set of Bitmap data and returns an intermediate state. This function is highly efficient when dealing with large-scale datasets, especially in scenarios where intersection operations on multiple Bitmaps are required. The returned intermediate state can be used for subsequent merge operations, enabling more complex aggregation logic.
Syntax
Parameters
bitmap
: An expression of typeBITMAP
, representing the Bitmap data to be operated on.
Return Value
The function returns an intermediate BITMAP
object, representing the intermediate result of the bitwise AND operation. This intermediate state can be used for subsequent merge operations.
Usage Example
Example 1: Using bitmapToArray
to View Results
Assume there is a table t
with a column v
that stores multiple arrays. Now, we need to compute the result of the bitwise AND operation on these arrays and convert it to an array format for easier viewing.
Result:
Notes
- Input Type: Ensure that the input
bitmap
is of typeBITMAP
; otherwise, the function execution will fail. - Intermediate State Usage: The returned intermediate state can be used for subsequent merge operations, enabling more complex aggregation logic.
- Performance Optimization: The
groupBitmapAndState
function is highly efficient for large-scale datasets. However, if the data volume is extremely large, performance impact should still be considered. Where possible, try to optimize the input data to improve the function's execution efficiency. - Client Support: Clients may not support directly printing
BITMAP
type results. If you need to view the results, use thebitmapToArray
function to convert the Bitmap to an array format.
Related Functions
groupBitmapAnd
: Directly computes the final result of the bitwise AND operation.groupBitmapMerge
: Merges multiple intermediate state Bitmap objects.bitmapAnd
: Performs a bitwise AND operation on two Bitmaps.bitmapToArray
: Converts a Bitmap to an array format for easier result inspection.