viirya commented on code in PR #60007:
URL: https://github.com/apache/spark/pull/60007#discussion_r4447128220
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveTableSpec.scala:
##########
@@ -118,6 +118,14 @@ object ResolveTableSpec extends Rule[LogicalPlan] {
external = u.external,
constraints = u.constraints.map(_.toV2Constraint))
withNewSpec(newTableSpec)
+ // `ResolveSubquery` skips these commands, so a subquery in an option
value never resolves.
+ case u: UnresolvedTableSpec =>
Review Comment:
Should this sit next to the CHECK-constraint subquery case above, before
`childrenResolved`? Here, a subquery that is resolved at parse time still goes
through `eval()`. So `('k' = (select 1 as x))` fails with `OPTION_IS_INVALID`
whose cause is `[INTERNAL_ERROR] Cannot evaluate expression:
scalar-subquery#...`, while `(select 1)` fails without one. Checking options up
front would keep both subquery rejections under one comment and make the error
independent of the other options. The `resolved` change would still be needed.
--
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]