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 string representation of the binary value of the given column. Supports Spark Connect.
For the corresponding Databricks SQL function, see bin function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.bin(col=<col>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or str |
Target column to work on. |
Returns
pyspark.sql.Column: binary representation of given value as string.
Examples
from pyspark.databricks.sql import functions as dbf
spark.range(10).select("*", dbf.bin("id")).show()
+---+-------+
| id|bin(id)|
+---+-------+
| 0| 0|
| 1| 1|
| 2| 10|
| 3| 11|
| 4| 100|
| 5| 101|
| 6| 110|
| 7| 111|
| 8| 1000|
| 9| 1001|
+---+-------+