srielau commented on code in PR #41335:
URL: https://github.com/apache/spark/pull/41335#discussion_r1295263767
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveIdentifierClause.scala:
##########
@@ -42,7 +42,12 @@ object ResolveIdentifierClause extends Rule[LogicalPlan] {
private def evalIdentifierExpr(expr: Expression): Seq[String] = {
expr match {
- case e if !e.foldable => expr.failAnalysis(
+ case e: Alias if !e.child.foldable => expr.failAnalysis(
+ errorClass = "NOT_A_CONSTANT_STRING.NOT_CONSTANT",
+ messageParameters = Map(
+ "name" -> "IDENTIFIER",
+ "expr" -> expr.sql))
+ case e if !e.isInstanceOf[Alias] && !e.foldable => expr.failAnalysis(
Review Comment:
Removed
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ColumnResolutionHelper.scala:
##########
@@ -305,16 +307,16 @@ trait ColumnResolutionHelper extends Logging {
} else {
variable
}
- }.map(e => Alias(e, nameParts.last)())
+ }.map(e => if (isTopLevel) Alias(e, nameParts.last)() else e )
}
e.transformWithPruning(_.containsAnyPattern(UNRESOLVED_ATTRIBUTE,
TEMP_RESOLVED_COLUMN)) {
Review Comment:
Removed
--
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]