srielau commented on code in PR #40474: URL: https://github.com/apache/spark/pull/40474#discussion_r1285376611
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/namedExpressions.scala: ########## @@ -429,6 +429,39 @@ case class OuterReference(e: NamedExpression) final override val nodePatterns: Seq[TreePattern] = Seq(OUTER_REFERENCE) } +/** + * A place holder used to hold a reference that has been resolved to a field outside of the current + * plan. This is used for correlated subqueries. + */ +case class VariableReference(varName: String, literal: Literal, canFold: Boolean = true) + extends LeafExpression { + + override def dataType: DataType = literal.dataType + override def nullable: Boolean = literal.nullable + override def prettyName: String = "session." + varName + override def foldable: Boolean = canFold + + override def sql: String = varName + + final override val nodePatterns: Seq[TreePattern] = Seq(RUNTIME_REPLACEABLE) Review Comment: OK, how about: VARIABLE_REFERENCE? -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org