Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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|
+-----+------------+