yadavay-amzn commented on code in PR #56472:
URL: https://github.com/apache/spark/pull/56472#discussion_r3503161842
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala:
##########
@@ -947,6 +947,21 @@ trait CheckAnalysis extends LookupCatalog with
QueryErrorsBase with PlanToString
messageParameters = Map("checkCondition" ->
a.checkConstraint.condition)
)
+ // Reject session/temp variables in persisted CHECK constraints.
+ case a: AddCheckConstraint =>
+ a.checkConstraint.child.collectFirst {
+ case v: VariableReference => v
+ }.foreach { v =>
+ v.failAnalysis(
Review Comment:
Extracted CheckConstraint.rejectTempVariables in the companion object - both
call sites (ResolveTableSpec and CheckAnalysis) now delegate to it, so the
detection logic and the error parameters live in one place.
--
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]