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.
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()