הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
Parses the expression string into the column that it represents. Supports Spark Connect.
Syntax
from pyspark.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.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|
+-----+------------+