viirya commented on a change in pull request #29947:
URL: https://github.com/apache/spark/pull/29947#discussion_r500711365
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala
##########
@@ -53,51 +53,80 @@ case class PrintToStderr(child: Expression) extends
UnaryExpression {
}
/**
- * A function throws an exception if 'condition' is not true.
+ * Throw with the result of an expression (used for debugging).
*/
@ExpressionDescription(
- usage = "_FUNC_(expr) - Throws an exception if `expr` is not true.",
+ usage = "_FUNC_(expr) - Throws an exception with `expr`.",
examples = """
Examples:
- > SELECT _FUNC_(0 < 1);
- NULL
+ > SELECT _FUNC_('custom error message');
+ java.lang.RuntimeException
+ custom error message
""",
- since = "2.0.0")
-case class AssertTrue(child: Expression) extends UnaryExpression with
ImplicitCastInputTypes {
-
- override def nullable: Boolean = true
-
- override def inputTypes: Seq[DataType] = Seq(BooleanType)
+ since = "3.1.0")
+case class RaiseError(child: Expression) extends UnaryExpression with
ImplicitCastInputTypes {
Review comment:
Oh, looks like it is true.
----------------------------------------------------------------
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]