diff --git a/proto/substrait/algebra.proto b/proto/substrait/algebra.proto index 8196dd2d7..49dfa0697 100644 --- a/proto/substrait/algebra.proto +++ b/proto/substrait/algebra.proto @@ -482,12 +482,12 @@ message Expression { message Cast { Type type = 1; Expression input = 2; - ConditionFlag condition_flag = 3; + FailureBehavior failure_behavior = 3; - enum ConditionFlag { - CONDITION_FLAG_UNSPECIFIED = 0; - CONDITION_FLAG_NULL_ON_FAILURE = 1; - CONDITION_FLAG_THROW_ON_FAILURE = 2; + enum FailureBehavior { + // throw an exception as default failure behavior + FAILURE_BEHAVIOR_UNSPECIFIED = 0; + FAILURE_BEHAVIOR_RETURN_NULL = 1; } } diff --git a/site/docs/expressions/specialized_record_expressions.md b/site/docs/expressions/specialized_record_expressions.md index bc24c2f9b..041cd1114 100644 --- a/site/docs/expressions/specialized_record_expressions.md +++ b/site/docs/expressions/specialized_record_expressions.md @@ -11,9 +11,7 @@ For each data type, it is possible to create a literal value for that data type. ## Cast Expression -To convert a value from one type to another, Substrait defines a cast expression. Cast expression declares an expected type, an input argument and an enumeration flag that contains enhancement conditions, such as `CONDITION_FLAG_NULL_ON_FAILURE` which prevents throws and instead returns null on cast failure. - - +To convert a value from one type to another, Substrait defines a cast expression. Cast expressions declare an expected type, an input argument and an enumeration specifying failure behavior, indicating whether cast should return null on failure or throw an exception. ## If Expression An if value expression is an expression composed of one if clause, zero or more else if clauses and an else clause. In pseudocode, they are envisioned as: