Bitwise Functions

Bitwise functions supported by e6data

BITWISE_OR( <expr>, <expr> )

Returns the bitwise OR of two numeric expressions.

> select bitwise_or(3,5);
7

BITWISE_XOR( <expr>, <expr> )

Returns the bitwise XOR of two numeric expressions.

> select bitwise_xor(3,5);
6

BITWISE_NOT( <expr>)

Returns the bitwise negation of a numeric expression.

> select bitwise_not(4);
-5

SHIFTRIGHT ( <expr>, <n> )

Alternate syntax: <expr> >> n;

Returns a bitwise signed right shifted by n bits.

> select shiftright(2, 1);
1
> select 2 >> 1;
1

SHIFTLEFT ( <expr>, <n> )

Alternate syntax: <expr> << n;

Returns a bitwise signed left shifted by n bits.

> select shiftleft(2, 1);
4
> select 2 << 1;
4

Last updated

#930: Cross account hive GCP

Change request updated