pyspark.sql.functions.shiftRight

pyspark.sql.functions.shiftRight(col, numBits)[source]

(Signed) shift the given value numBits right.

New in version 1.5.0.

Examples

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