Skip to main content

GROUP_BIT_XOR

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 all INT types

Return Value

Returns an integer value

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);
select * from group_bit;
+-------+
| value |
+-------+
| 3 |
| 1 |
| 2 |
| 4 |
+-------+
select group_bit_xor(value) from group_bit;
+------------------------+
| group_bit_xor(`value`) |
+------------------------+
| 4 |
+------------------------+