Nota
Capaian ke halaman ini memerlukan kebenaran. Anda boleh cuba mendaftar masuk atau menukar direktori.
Capaian ke halaman ini memerlukan kebenaran. Anda boleh cuba menukar direktori.
Formats the arguments in printf-style and returns the result as a string column.
For the corresponding Databricks SQL function, see printf function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.printf(format=<format>, *cols=<*cols>)
Parameters
| Parameter | Type | Description |
|---|---|---|
format |
pyspark.sql.Column or str |
string that can contain embedded format tags and used as result column's value |
cols |
pyspark.sql.Column or str |
column names or pyspark.sql.Column to be used in formatting |
Examples
from pyspark.databricks.sql import functions as dbf
spark.createDataFrame(
[("aa%d%s", 123, "cc",)], ["a", "b", "c"]
).select(dbf.printf("a", "b", "c")).show()