Skip to content

Commit d151497

Browse files
committed
Fix break change
1 parent 88c7eb4 commit d151497

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/QueryCompilationErrors.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ object QueryCompilationErrors {
231231
}
232232

233233
def invalidStarUsageError(prettyName: String): Throwable = {
234-
new AnalysisException(s"Invalid usage of '*' in expression '$prettyName'")
234+
new AnalysisException(s"Invalid usage of '*' in $prettyName")
235235
}
236236

237237
def orderByPositionRangeError(index: Int, size: Int, t: TreeNode[_]): Throwable = {
@@ -292,8 +292,8 @@ object QueryCompilationErrors {
292292
s"Please file a bug report with this error message, stack trace, and the query.")
293293
}
294294

295-
def windowFunctionNotAllowedError(): Throwable = {
296-
new AnalysisException("It is not allowed to use window functions inside WHERE/HAVING clause")
295+
def windowFunctionNotAllowedError(clauseName: String): Throwable = {
296+
new AnalysisException(s"It is not allowed to use window functions inside $clauseName clause")
297297
}
298298

299299
def cannotSpecifyWindowFrameError(prettyName: String): Throwable = {

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,7 +1476,7 @@ class Analyzer(override val catalogManager: CatalogManager)
14761476
}
14771477
)
14781478
case g: Generate if containsStar(g.generator.children) =>
1479-
throw QueryCompilationErrors.invalidStarUsageError(g.generator.prettyName)
1479+
throw QueryCompilationErrors.invalidStarUsageError("explode/json_tuple/UDTF")
14801480

14811481
// To resolve duplicate expression IDs for Join and Intersect
14821482
case j @ Join(left, right, _, _, _) if !j.duplicateResolved =>
@@ -1736,7 +1736,7 @@ class Analyzer(override val catalogManager: CatalogManager)
17361736
})
17371737
// count(*) has been replaced by count(1)
17381738
case o if containsStar(o.children) =>
1739-
throw QueryCompilationErrors.invalidStarUsageError(o.prettyName)
1739+
throw QueryCompilationErrors.invalidStarUsageError(s"expression '${o.prettyName}'")
17401740
}
17411741
}
17421742
}
@@ -2836,10 +2836,10 @@ class Analyzer(override val catalogManager: CatalogManager)
28362836
def apply(plan: LogicalPlan): LogicalPlan = plan resolveOperatorsDown {
28372837

28382838
case Filter(condition, _) if hasWindowFunction(condition) =>
2839-
throw QueryCompilationErrors.windowFunctionNotAllowedError
2839+
throw QueryCompilationErrors.windowFunctionNotAllowedError("WHERE")
28402840

28412841
case UnresolvedHaving(condition, _) if hasWindowFunction(condition) =>
2842-
throw QueryCompilationErrors.windowFunctionNotAllowedError
2842+
throw QueryCompilationErrors.windowFunctionNotAllowedError("HAVING")
28432843

28442844
// Aggregate with Having clause. This rule works with an unresolved Aggregate because
28452845
// a resolved Aggregate will not have Window Functions.

0 commit comments

Comments
 (0)