cloud-fan commented on code in PR #40989:
URL: https://github.com/apache/spark/pull/40989#discussion_r1188008135
##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala:
##########
@@ -418,6 +433,36 @@ class SQLQueryTestSuite extends QueryTest with
SharedSparkSession with SQLHelper
}
}
+ def expandCTEQueryAndCompareResult(
+ session: SparkSession,
+ query: String,
+ output: ExecutionOutput): Unit = {
+ val logicalPlan: LogicalPlan =
session.sessionState.sqlParser.parsePlan(query)
+ // For non-command query with CTE, compare the results of selecting from
view created on the
+ // original query.
Review Comment:
note: this may not always work. CREATE VIEW requires unique column names but
a query can output columns with the same name. We can add one more condition
here and only trigger the view test if the output schema has no duplicated
names.
--
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]