GROPU_BITMAP_XOR_STATE
Introduction
The GROPU_BITMAP_XOR_STATE
function is used to compute the bitwise XOR 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 XOR 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 XOR operation. This intermediate state can be used for subsequent merge operations.
Usage Example
Example 1: Computing the Intermediate State of Bitwise XOR for Multiple Bitmaps
Assume there is a table t
with a column v
that stores multiple arrays. Now, we need to compute the intermediate state of the bitwise XOR operation on these arrays.
Result: Returns an intermediate Bitmap object representing the intermediate result of the bitwise XOR operation.
Example 2: Combined with groupBitmapMerge
The groupBitmapMerge
function is used to merge multiple intermediate Bitmap objects and generate a complete Bitmap.
Result: Returns a complete Bitmap representing the result of the bitwise XOR operation on all input Bitmaps.
Example 3: Directly Computing the Final Result
The groupBitmapXor
function is used to directly compute the final result of the bitwise XOR operation, suitable for scenarios where intermediate states are not required.
Result: Returns a complete Bitmap representing the result of the bitwise XOR operation on all input Bitmaps.
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
groupBitmapXorState
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, you can use thebitmapToArray
function to convert the Bitmap to an array format.
Related Functions
groupBitmapXor
: Directly computes the final result of the bitwise XOR operation.groupBitmapMerge
: Merges multiple intermediate Bitmap objects.bitmapXor
: Performs a bitwise XOR operation on two Bitmaps.bitmapToArray
: Converts a Bitmap to an array format for easier result inspection.