AngersZhuuuu commented on a change in pull request #33324:
URL: https://github.com/apache/spark/pull/33324#discussion_r671400068
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
##########
@@ -4058,6 +4058,39 @@ 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(FLAG INT, CAL_DT DATE)
+ |USING PARQUET
+ |PARTITIONED BY (CAL_DT)""".stripMargin)
+ val insert = sql(
+ """
+ |INSERT INTO t2 SELECT 2 AS FLAG,CAL_DT FROM t1_v
+ |WHERE CAL_DT BETWEEN '2021-06-29' AND '2021-06-30'""".stripMargin)
+ insert.queryExecution.executedPlan.collectFirst {
+ case CommandResultExec(_, DataWritingCommandExec(
+ i: InsertIntoHadoopFsRelationCommand, _), _) => i
Review comment:
> nit: one more indent?
two is more better? updated
--
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]