pyspark.sql.functions.
shiftright
(Signed) shift the given value numBits right.
New in version 3.2.0.
Changed in version 3.4.0: Supports Spark Connect.
Column
input column of values to shift.
number of bits to shift.
shifted values.
Examples
>>> spark.createDataFrame([(42,)], ['a']).select(shiftright('a', 1).alias('r')).collect() [Row(r=21)]