הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
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.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.sql import functions as dbf
spark.sql("SELECT * FROM VALUES (0), (1), (2), (3), (NULL) AS TAB(value)").select("*", dbf.bit_count("value")).show()