aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongjoon Hyun <dongjoon@apache.org>2016-04-23 16:39:35 -0700
committerDavies Liu <davies.liu@gmail.com>2016-04-23 16:39:35 -0700
commitbebb0240e6ece6ec7c79bdd62098529146fcb0c0 (patch)
tree27e8976c8907c39b07640e00120537b6e1fb6c6c
parent162e12b085692d67fd3b2bd1254152cb56db0722 (diff)
downloadspark-bebb0240e6ece6ec7c79bdd62098529146fcb0c0.tar.gz
spark-bebb0240e6ece6ec7c79bdd62098529146fcb0c0.tar.bz2
spark-bebb0240e6ece6ec7c79bdd62098529146fcb0c0.zip
[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.
-rw-r--r--sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala
index 7dacdafb71..c26faee2f4 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala
@@ -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.