Note
Ang pag-access sa pahinang ito ay nangangailangan ng pahintulot. Maaari mong subukang mag-sign in o magpalit ng mga direktoryo.
Ang pag-access sa pahinang ito ay nangangailangan ng pahintulot. Maaari mong subukang baguhin ang mga direktoryo.
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|
+---+-------+