ueshin commented on a change in pull request #32424:
URL: https://github.com/apache/spark/pull/32424#discussion_r626001928
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/DataFrameFunctionsSuite.scala
##########
@@ -3629,6 +3629,29 @@ class DataFrameFunctionsSuite extends QueryTest with
SharedSparkSession {
df.select(map(map_entries($"m"), lit(1))),
Row(Map(Seq(Row(1, "a")) -> 1)))
}
+
+ test("SPARK-34794: lambda variable name issues in nested functions") {
+ val df1 = Seq((Seq(1, 2), Seq("a", "b"))).toDF("numbers", "letters")
+
+ checkAnswer(df1.select(flatten(transform($"numbers", (number: Column) =>
+ transform($"letters", (letter: Column) =>
+ struct(number, letter))))),
+ Seq(Row(Seq(Row(1, "a"), Row(1, "b"), Row(2, "a"), Row(2, "b"))))
Review comment:
nit: style. should be 2-space indent?
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]