ilicmarkodb commented on code in PR #53735:
URL: https://github.com/apache/spark/pull/53735#discussion_r2673170155


##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala:
##########
@@ -812,6 +812,38 @@ class SQLQuerySuite extends QueryTest with 
SharedSparkSession with AdaptiveSpark
       Row(null, null, 6, "F") :: Nil)
   }
 
+  test("LATERAL VIEW explode with column reference") {
+    withTempView("test_data") {
+      sql("""
+        CREATE TEMPORARY VIEW test_data AS
+        SELECT 1 as c1, array(10, 20, 30) as c2
+        UNION ALL SELECT 2, array(15, 25, 35)
+        UNION ALL SELECT 3, array(12, 22, 32)
+      """)
+
+      val result = sql("""
+        SELECT c1, c2, col
+        FROM test_data
+        LATERAL VIEW explode(c2) AS col
+      """)
+
+      checkAnswer(
+        result,
+        Seq(
+          Row(1, Seq(10, 20, 30), 10),
+          Row(1, Seq(10, 20, 30), 20),
+          Row(1, Seq(10, 20, 30), 30),
+          Row(2, Seq(15, 25, 35), 15),
+          Row(2, Seq(15, 25, 35), 25),
+          Row(2, Seq(15, 25, 35), 35),
+          Row(3, Seq(12, 22, 32), 12),
+          Row(3, Seq(12, 22, 32), 22),
+          Row(3, Seq(12, 22, 32), 32)
+        )
+      )
+    }

Review Comment:
   This shouldn't be affected by the change, but let's have a test anyway



-- 
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]

Reply via email to