{ “title”: “GROUP_BIT_XOR”, “language”: “en”, “description”: “Performs a bitwise XOR operation on all values in a single integer column or expression.” }

Description

Performs a bitwise XOR operation on all values in a single integer column or expression.

Syntax

GROUP_BIT_XOR(<expr>)

Parameters

ParameterDescription
<expr>Supports types: TinyInt, SmallInt, Integer, BigInt, LargeInt.

Return Value

Returns an integer value of the same type as . If all values are NULL, returns NULL. NULL values are not involved in the bitwise operation.

Example

-- setup
create table group_bit(
    value int
) distributed by hash(value) buckets 1
properties ("replication_num"="1");

insert into group_bit values
    (3),
    (1),
    (2),
    (4),
    (NULL);
select group_bit_xor(value) from group_bit;
+----------------------+
| group_bit_xor(value) |
+----------------------+
|                    4 |
+----------------------+
select group_bit_xor(value) from group_bit where value is null;
+----------------------+
| group_bit_xor(value) |
+----------------------+
|                 NULL |
+----------------------+