Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-41574][SQL] Update _LEGACY_ERROR_TEMP_2009 as INTERNAL_ERROR. #39389

Closed
wants to merge 12 commits into from
5 changes: 0 additions & 5 deletions core/src/main/resources/error/error-classes.json
Original file line number Diff line number Diff line change
Expand Up @@ -3518,11 +3518,6 @@
"Find an invalid url string <url>. If necessary set <ansiConfig> to false to bypass this error."
]
},
"_LEGACY_ERROR_TEMP_2009" : {
"message" : [
"dataType"
]
},
"_LEGACY_ERROR_TEMP_2010" : {
"message" : [
"Window Functions do not support merging."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import org.apache.spark.sql.catalyst.expressions.Cast.{toSQLExpr, toSQLType}
import org.apache.spark.sql.catalyst.expressions.aggregate.{AggregateFunction, DeclarativeAggregate, NoOp}
import org.apache.spark.sql.catalyst.trees.{BinaryLike, LeafLike, TernaryLike, UnaryLike}
import org.apache.spark.sql.catalyst.trees.TreePattern.{TreePattern, UNRESOLVED_WINDOW_EXPRESSION, WINDOW_EXPRESSION}
import org.apache.spark.sql.errors.{QueryErrorsBase, QueryExecutionErrors}
import org.apache.spark.sql.errors.{QueryCompilationErrors, QueryErrorsBase, QueryExecutionErrors}
import org.apache.spark.sql.types._

/**
Expand Down Expand Up @@ -62,7 +62,7 @@ case class WindowSpecDefinition(
checkInputDataTypes().isSuccess

override def nullable: Boolean = true
override def dataType: DataType = throw QueryExecutionErrors.dataTypeOperationUnsupportedError
override def dataType: DataType = throw QueryCompilationErrors.dataTypeOperationUnsupportedError

override def checkInputDataTypes(): TypeCheckResult = {
frameSpecification match {
Expand Down Expand Up @@ -182,7 +182,7 @@ case object CurrentRow extends SpecialFrameBoundary {
* Represents a window frame.
*/
sealed trait WindowFrame extends Expression with Unevaluable {
override def dataType: DataType = throw QueryExecutionErrors.dataTypeOperationUnsupportedError
override def dataType: DataType = throw QueryCompilationErrors.dataTypeOperationUnsupportedError
override def nullable: Boolean = false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3401,4 +3401,9 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase {
)
)
}

def dataTypeOperationUnsupportedError(): Throwable = {
SparkException.internalError(
"The operation `dataType` is not supported.")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,6 @@ private[sql] object QueryExecutionErrors extends QueryErrorsBase {
)
}

def dataTypeOperationUnsupportedError(): SparkUnsupportedOperationException = {
new SparkUnsupportedOperationException(
errorClass = "_LEGACY_ERROR_TEMP_2009",
messageParameters = Map.empty)
}

def mergeUnsupportedByWindowFunctionError(): SparkUnsupportedOperationException = {
new SparkUnsupportedOperationException(
errorClass = "_LEGACY_ERROR_TEMP_2010",
Expand Down