Skip to content

Commit

Permalink
fix: address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ZJie1 committed May 13, 2022
1 parent 9459ccd commit 3aac04a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 5 additions & 5 deletions proto/substrait/algebra.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
4 changes: 1 addition & 3 deletions site/docs/expressions/specialized_record_expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3aac04a

Please sign in to comment.