Skip to content

Commit

Permalink
fix test error
Browse files Browse the repository at this point in the history
  • Loading branch information
dengziming committed Mar 4, 2024
1 parent ee876f3 commit 0a07e63
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
6 changes: 0 additions & 6 deletions docs/sql-error-conditions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2502,12 +2502,6 @@ The deserializer is not supported:

For more details see [UNSUPPORTED_DESERIALIZER](sql-error-conditions-unsupported-deserializer-error-class.html)

### UNSUPPORTED_ENCODER

[SQLSTATE: 0A000](sql-error-conditions-sqlstates.html#class-0A-feature-not-supported)

Only expression encoders are supported for now.

### UNSUPPORTED_EXPRESSION_GENERATED_COLUMN

[SQLSTATE: 42621](sql-error-conditions-sqlstates.html#class-42-syntax-error-or-access-rule-violation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ class QueryExecutionErrorsSuite


test("UnaryExpression should override eval or nullSafeEval") {
case class NyUnaryExpression(child: Expression)
case class MyUnaryExpression(child: Expression)
extends UnaryExpression {
override def dataType: DataType = IntegerType

Expand All @@ -1201,13 +1201,14 @@ class QueryExecutionErrorsSuite
override protected def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = null
}

val expr = MyUnaryExpression(Literal.create(1, IntegerType))
checkError(
exception = intercept[SparkRuntimeException] {
NyUnaryExpression(Literal.create(1, IntegerType)).eval(EmptyRow)
expr.eval(EmptyRow)
},
errorClass = "CLASS_NOT_OVERRIDE_EXPECTED_METHOD",
parameters = Map(
"className" -> "UnaryExpression",
"className" -> expr.getClass.getName,
"method1" -> "eval",
"method2" -> "nullSafeEval"
)
Expand Down

0 comments on commit 0a07e63

Please sign in to comment.