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.
Parses the expression string into the column that it represents. Supports Spark Connect.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.expr(str=<str>)
Parameters
| Parameter | Type | Description |
|---|---|---|
str |
str |
Expression defined in string. |
Returns
pyspark.sql.Column: column representing the expression.
Examples
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([["Alice"], ["Bob"]], ["name"])
df.select("*", dbf.expr("length(name)")).show()
+-----+------------+
| name|length(name)|
+-----+------------+
|Alice| 5|
| Bob| 3|
+-----+------------+