pyspark.sql.functions.shiftright

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

(Signed) shift the given value numBits right.

New in version 3.2.0.

Examples

>>> spark.createDataFrame([(42,)], ['a']).select(shiftright('a', 1).alias('r')).collect()
[Row(r=21)]