pyspark.sql.functions.shiftrightunsigned

pyspark.sql.functions.shiftrightunsigned(col: ColumnOrName, numBits: int) → pyspark.sql.column.Column[source]

Unsigned shift the given value numBits right.

New in version 3.2.0.

Changed in version 3.4.0: Supports Spark Connect.

Parameters
colColumn or str

input column of values to shift.

numBitsint

number of bits to shift.

Returns
Column

shifted value.

Examples

>>> df = spark.createDataFrame([(-42,)], ['a'])
>>> df.select(shiftrightunsigned('a', 1).alias('r')).collect()
[Row(r=9223372036854775787)]