หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
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|
+-----+------------+