Biruk Tesfaye created SPARK-48852:
-------------------------------------
Summary: String trim function returning incorrect results in Spark
connect
Key: SPARK-48852
URL: https://issues.apache.org/jira/browse/SPARK-48852
Project: Spark
Issue Type: Bug
Components: Connect
Affects Versions: 3.5.0
Reporter: Biruk Tesfaye
With spark connect, the snippet:
{code:java}
import org.apache.spark.sql.functions.trim
import spark.implicits._
val df = Seq((" john"), ("jane "), (" ann ")).toDF("name")
val trimmedDF = df.withColumn("name", trim($"name", " "))
trimmedDF.collect(){code}
returns an incorrect result
{code:java}
Array[Row] = Array([], [], []){code}
We get the same result when using `{{{}rtrim{}}}` and `{{{}ltrim{}}}` as well.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]