beliefer commented on a change in pull request #30564:
URL: https://github.com/apache/spark/pull/30564#discussion_r535865994
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/QueryCompilationErrors.scala
##########
@@ -159,6 +164,174 @@ object QueryCompilationErrors {
s"Couldn't find the reference column for $after at $parentName")
}
-}
+ def windowSpecificationNotDefinedError(windowName: String): Throwable = {
+ new AnalysisException(s"Window specification $windowName is not defined in
the WINDOW clause.")
+ }
+
+ def selectExprNotInGroupByError(expr: Expression, groupByAliases:
Seq[Alias]): Throwable = {
+ new AnalysisException(s"$expr doesn't show up in the GROUP BY list
$groupByAliases")
+ }
+
+ def groupingMustWithGroupingSetsOrCubeOrRollupError(): Throwable = {
+ new AnalysisException("grouping()/grouping_id() can only be used with
GroupingSets/Cube/Rollup")
+ }
+
+ def pandasUDFAggregateNotSupportedInPivotError(): Throwable = {
+ new AnalysisException("Pandas UDF aggregate expressions are currently not
supported in pivot.")
+ }
+
+ def aggregateExpressionRequiredForPivotError(sql: String): Throwable = {
+ new AnalysisException(s"Aggregate expression required for pivot, but
'$sql' " +
+ "did not appear in any aggregate function.")
+ }
+
+ def expectedTableNotTempViewError(quoted: String, cmd: String, t:
TreeNode[_]): Throwable = {
+ new AnalysisException(s"$quoted is a temp view. '$cmd' expects a table",
+ t.origin.line, t.origin.startPosition)
+ }
+
+ def expectedTableOrPermanentViewNotTempViewError(
+ quoted: String, cmd: String, t: TreeNode[_]): Throwable = {
+ new AnalysisException(s"$quoted is a temp view. '$cmd' expects a table or
permanent view.",
+ t.origin.line, t.origin.startPosition)
+ }
+
+ def viewDepthExceedsMaxResolutionDepthError(
+ identifier: TableIdentifier, maxNestedViewDepth: Int, t: TreeNode[_]):
Throwable = {
+ new AnalysisException(s"The depth of view $identifier exceeds the maximum
" +
+ s"view resolution depth ($maxNestedViewDepth). Analysis is aborted to " +
+ s"avoid errors. Increase the value of
${SQLConf.MAX_NESTED_VIEW_DEPTH.key} to work " +
+ "around this.", t.origin.line, t.origin.startPosition)
+ }
+
+ def insertingIntoViewNotAllowedError(identifier: TableIdentifier, t:
TreeNode[_]): Throwable = {
+ new AnalysisException(s"Inserting into a view is not allowed. View:
$identifier.",
+ t.origin.line, t.origin.startPosition)
+ }
+
+ def writingIntoViewNotAllowedError(identifier: TableIdentifier, t:
TreeNode[_]): Throwable = {
+ new AnalysisException(s"Writing into a view is not allowed. View:
$identifier.",
+ t.origin.line, t.origin.startPosition)
+ }
+
+ def writingIntoV1TableNotAllowedError(identifier: TableIdentifier, t:
TreeNode[_]): Throwable = {
+ new AnalysisException(s"Cannot write into v1 table: $identifier.",
+ t.origin.line, t.origin.startPosition)
+ }
+
+ def expectsTableNotViewError(v: ResolvedView, cmd: String, t: TreeNode[_]):
Throwable = {
Review comment:
The parameter very difference.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]