AngersZhuuuu commented on a change in pull request #33324:
URL: https://github.com/apache/spark/pull/33324#discussion_r670912707
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
##########
@@ -4058,6 +4058,44 @@ class SQLQuerySuite extends QueryTest with
SharedSparkSession with AdaptiveSpark
Row(1, 2, 1, 2) :: Nil)
}
}
+
+ test("SPARK-36093: RemoveRedundantAliases should not change expression's
name") {
+ withTable("t1", "t2") {
+ withView("t1_v") {
+ sql("CREATE TABLE t1(cal_dt DATE) USING PARQUET")
+ sql(
+ """
+ |INSERT INTO t1 VALUES
+ |(date'2021-06-27'),
+ |(date'2021-06-28'),
+ |(date'2021-06-29'),
+ |(date'2021-06-30')""".stripMargin)
+ sql("CREATE VIEW t1_v AS SELECT * FROM t1")
+ sql(
+ """
+ |CREATE TABLE t2
+ |USING PARQUET
+ |PARTITIONED BY (CAL_DT)
+ |AS
+ |SELECT 1 AS FLAG,CAL_DT FROM t1_v
+ |WHERE CAL_DT BETWEEN '2021-06-27' AND '2021-06-28'""".stripMargin)
Review comment:
> so the first CTAS works fine before this PR? can we add
`checkAnswer...` here?
Yes, since it use DataSource and store partition column as Seq[String], when
executing generate InsertIntoHadoopFsRelation use resolver. So the
partitionColumns is not changed.
--
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]