cloud-fan commented on code in PR #48664:
URL: https://github.com/apache/spark/pull/48664#discussion_r1837461263
##########
sql/api/src/main/scala/org/apache/spark/sql/internal/columnNodes.scala:
##########
@@ -167,6 +167,24 @@ private[sql] object UnresolvedAttribute {
apply(unparsedIdentifier, None, false, CurrentOrigin.get)
}
+/**
+ * Reference to an attribute in the outer context, used for Subqueries.
+ *
+ * @param nameParts
+ * name of the attribute.
+ * @param planId
+ * id of the plan (Dataframe) that produces the attribute.
+ */
+private[sql] case class LazyOuterReference(
+ nameParts: Seq[String],
+ planId: Option[Long] = None,
+ override val origin: Origin = CurrentOrigin.get)
+ extends ColumnNode {
+ override private[internal] def normalize(): LazyOuterReference =
+ copy(planId = None, origin = NO_ORIGIN)
+ override def sql: String = nameParts.map(n => if (n.contains(".")) s"`$n`"
else n).mkString(".")
Review Comment:
let's be consistent with other parts in spark SQL and use
`QuotingUtils.quoteIfNeeded`
--
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]