Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Returns the number of bits that are set in the argument expr as an unsigned 64-bit integer, or NULL if the argument is NULL.
For the corresponding Databricks SQL function, see bit_count function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.bit_count(col=<col>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or str |
target column to compute on. |
Returns
pyspark.sql.Column or NULL if the argument is NULL.: the number of bits that are set in the argument expr as an unsigned 64-bit integer,
Examples
from pyspark.databricks.sql import functions as dbf
spark.sql("SELECT * FROM VALUES (0), (1), (2), (3), (NULL) AS TAB(value)").select("*", dbf.bit_count("value")).show()