dtenedor commented on code in PR #48649:
URL: https://github.com/apache/spark/pull/48649#discussion_r1839084480
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -428,12 +428,22 @@ class Analyzer(override val catalogManager:
CatalogManager) extends RuleExecutor
def apply(plan: LogicalPlan): LogicalPlan =
plan.resolveOperatorsUpWithPruning(
_.containsAnyPattern(WITH_WINDOW_DEFINITION,
UNRESOLVED_WINDOW_EXPRESSION), ruleId) {
// Lookup WindowSpecDefinitions. This rule works with unresolved
children.
- case WithWindowDefinition(windowDefinitions, child) =>
child.resolveExpressions {
- case UnresolvedWindowExpression(c, WindowSpecReference(windowName)) =>
- val windowSpecDefinition = windowDefinitions.getOrElse(windowName,
- throw
QueryCompilationErrors.windowSpecificationNotDefinedError(windowName))
- WindowExpression(c, windowSpecDefinition)
- }
+ case WithWindowDefinition(windowDefinitions, child, forPipeSQL) =>
+ if (forPipeSQL) {
+ child.transformExpressions {
+ case UnresolvedWindowExpression(c,
WindowSpecReference(windowName)) =>
Review Comment:
this `case` is duplicated with L441-444 below; should we dedup them into a
lambda?
--
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]