viirya 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_r384947817
########## 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: I changed the test added by SPARK-30870, because the root cause of the failure is not due to selecting whole structure. Here I change this test to more fit the original purpose of SPARK-30870: when selecting whole structure, column pruning shouldn't alias the nested column. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org