Skip to content
Snippets Groups Projects
Commit bebb0240 authored by Dongjoon Hyun's avatar Dongjoon Hyun Committed by Davies Liu
Browse files

[MINOR] [SQL] Fix error message string in nullSafeEvel of TernaryExpression

## What changes were proposed in this pull request?

TernaryExpressions should thows proper error message for itself.
```scala
   protected def nullSafeEval(input1: Any, input2: Any, input3: Any): Any =
-    sys.error(s"BinaryExpressions must override either eval or nullSafeEval")
+    sys.error(s"TernaryExpressions must override either eval or nullSafeEval")
```

## How was this patch tested?

Manual.

Author: Dongjoon Hyun <dongjoon@apache.org>

Closes #12642 from dongjoon-hyun/minor_fix_error_msg_in_ternaryexpression.
parent 162e12b0
No related branches found
No related tags found
No related merge requests found
......@@ -45,6 +45,7 @@ import org.apache.spark.sql.types._
* - [[LeafExpression]]: an expression that has no child.
* - [[UnaryExpression]]: an expression that has one child.
* - [[BinaryExpression]]: an expression that has two children.
* - [[TernaryExpression]]: an expression that has three children.
* - [[BinaryOperator]]: a special case of [[BinaryExpression]] that requires two children to have
* the same output data type.
*
......@@ -531,7 +532,7 @@ abstract class TernaryExpression extends Expression {
* of evaluation process, we should override [[eval]].
*/
protected def nullSafeEval(input1: Any, input2: Any, input3: Any): Any =
sys.error(s"BinaryExpressions must override either eval or nullSafeEval")
sys.error(s"TernaryExpressions must override either eval or nullSafeEval")
/**
* Short hand for generating ternary evaluation code.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment