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 5399c32 commit 05169d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 4 additions & 5 deletions proto/substrait/algebra.proto
Original file line number Diff line number Diff line change
Expand Up @@ -482,12 +482,11 @@ message Expression {
message Cast {
Type type = 1;
Expression input = 2;
CastFailureBehavior failure_behavior = 3;
FailureBehavior failure_behavior = 3;

enum CastFailureBehavior {
CONDITION_FLAG_UNSPECIFIED = 0;
CONDITION_FLAG_NULL_ON_FAILURE = 1;
CONDITION_FLAG_THROW_ON_FAILURE = 2;
enum FailureBehavior {
FAILURE_BEHAVIOR_THROW_EXCEPTION = 0;
FAILURE_BEHAVIOR_RETURN_NULL = 1;
}
}

Expand Down
3 changes: 1 addition & 2 deletions site/docs/expressions/specialized_record_expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +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. A Cast expression declares an expected type, an input argument and an argument specifying whether the operation should throw or return null on 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 05169d3

Please sign in to comment.