cloud-fan commented on code in PR #43614:
URL: https://github.com/apache/spark/pull/43614#discussion_r1386079358
##########
sql/core/src/test/scala/org/apache/spark/sql/CTEInlineSuite.scala:
##########
@@ -678,6 +678,17 @@ abstract class CTEInlineSuiteBase
}.isDefined, "CTE columns should not be pruned.")
}
}
+
+ test("SPARK-45752: Unreferenced CTE should all be checked by
CheckAnalysis0") {
+ val e = intercept[AnalysisException](sql(
+ s"""
+ |with
+ |a as (select * from non_exist),
+ |b as (select * from a)
+ |select 2
+ |""".stripMargin))
+ assert(e.getMessage.contains("[TABLE_OR_VIEW_NOT_FOUND]"))
Review Comment:
we should use the `checkError` testing function.
--
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]