From 58c77bab93173969e37fd5dd4619f514816e1196 Mon Sep 17 00:00:00 2001 From: Zhihong Yu Date: Wed, 11 Dec 2024 09:19:40 +0900 Subject: [PATCH] [SPARK-49349][SQL][FOLLOWUP] Rename isContainsUnsupportedLCA function ### What changes were proposed in this pull request? As follow-up to https://github.com/apache/spark/pull/48915, this PR renames `isContainsUnsupportedLCA` function ### Why are the changes needed? The renamed function is easier to understand. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? No change in functionality. Existing tests suffice. ### Was this patch authored or co-authored using generative AI tooling? No Closes #49134 from tedyu/cont-unsup. Authored-by: Zhihong Yu Signed-off-by: Hyukjin Kwon --- .../apache/spark/sql/catalyst/analysis/CheckAnalysis.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala index aaae763991f10..8f4431cb1ac11 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala @@ -192,7 +192,7 @@ trait CheckAnalysis extends PredicateHelper with LookupCatalog with QueryErrorsB ) } - private def isContainsUnsupportedLCA(e: Expression, operator: LogicalPlan): Boolean = { + private def containsUnsupportedLCA(e: Expression, operator: LogicalPlan): Boolean = { e.containsPattern(LATERAL_COLUMN_ALIAS_REFERENCE) && operator.expressions.exists { case a: Alias if e.collect { case l: LateralColumnAliasReference => l.nameParts.head }.contains(a.name) => @@ -369,7 +369,7 @@ trait CheckAnalysis extends PredicateHelper with LookupCatalog with QueryErrorsB case GetMapValue(map, key: Attribute) if isMapWithStringKey(map) && !key.resolved => failUnresolvedAttribute(operator, key, "UNRESOLVED_MAP_KEY") - case e: Expression if isContainsUnsupportedLCA(e, operator) => + case e: Expression if containsUnsupportedLCA(e, operator) => val lcaRefNames = e.collect { case lcaRef: LateralColumnAliasReference => lcaRef.name }.distinct failAnalysis(