cloud-fan commented on code in PR #52537:
URL: https://github.com/apache/spark/pull/52537#discussion_r2415261898
##########
sql/connect/client/jvm/src/test/scala/org/apache/spark/sql/connect/ColumnTestSuite.scala:
##########
@@ -209,4 +209,30 @@ class ColumnTestSuite extends ConnectFunSuite {
testColName(structType1, _.struct(structType1))
import org.apache.spark.util.ArrayImplicits._
testColName(structType2, _.struct(structType2.fields.toImmutableArraySeq:
_*))
+
+ test("transform with named function") {
+ val a = fn.col("a")
+ def addOne(c: Column): Column = c + 1
+ val transformed = a.transform(addOne)
+ assert(transformed == (a + 1))
+ }
+
+ test("transform with lambda") {
Review Comment:
can we also test with an existing function in
`org.apache.spark.sql.functions`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]