(簽名)將給定值 numBits 向右移動。
關於對應的 Databricks SQL 函式,請參見 shiftright 函數。
語法
from pyspark.databricks.sql import functions as dbf
dbf.shiftright(col=<col>, numBits=<numBits>)
參數
| 參數 | 類型 | Description |
|---|---|---|
col |
pyspark.sql.Column 或 str |
輸入欄位的值以進行移動。 |
numBits |
int |
需要移位的位元數。 |
退貨
pyspark.sql.Column:價值觀的變動。
範例
from pyspark.databricks.sql import functions as dbf
spark.range(4).select("*", dbf.shiftright('id', 1)).show()