dongjoon-hyun commented on a change in pull request #27702: [SPARK-30955][SQL] 
Exclude Generate output when aliasing in nested column pruning
URL: https://github.com/apache/spark/pull/27702#discussion_r384904993
 
 

 ##########
 File path: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
 ##########
 @@ -3394,15 +3395,25 @@ class SQLQuerySuite extends QueryTest with 
SharedSparkSession with AdaptiveSpark
     }
   }
 
-  test("SPARK-30870: Column pruning shouldn't alias a nested column if it 
means the whole " +
-    "structure") {
-    val df = sql(
-      """
-        |SELECT explodedvalue.field
-        |FROM VALUES array(named_struct('field', named_struct('a', 1, 'b', 
2))) AS (value)
-        |LATERAL VIEW explode(value) AS explodedvalue
-      """.stripMargin)
-    checkAnswer(df, Row(Row(1, 2)) :: Nil)
+  test("SPARK-30870: Column pruning shouldn't alias a nested column for the 
whole structure") {
+    withTable("t") {
+      val df = sql(
+        """
+          |SELECT value
+          |FROM VALUES array(named_struct('field', named_struct('a', 1, 'b', 
2))) AS (value)
+        """.stripMargin)
+      df.write.format("parquet").saveAsTable("t")
 
 Review comment:
   The below test coverage looks better. Last time, it checked only the 
exception occurs or not. BTW, do we need to store as table to avoid some local 
table optimization?

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to