Skip to content

Commit

Permalink
feat: literals for extension types (#197)
Browse files Browse the repository at this point in the history
Add protobuf fields and messages to support specifying literals for
user-defined types, and for specifying type variations in literals.
  • Loading branch information
jvanstraten authored May 16, 2022
1 parent 129e52f commit 296c266
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions proto/substrait/algebra.proto
Original file line number Diff line number Diff line change
Expand Up @@ -376,13 +376,19 @@ message Expression {
List list = 30;
Type.List empty_list = 31;
Type.Map empty_map = 32;
UserDefined user_defined = 33;
}

// whether the literal type should be treated as a nullable type. Applies to
// all members of union other than the Typed null (which should directly
// declare nullability).
bool nullable = 50;

// optionally points to a type_variation_anchor defined in this plan.
// Applies to all members of union other than the Typed null (which should
// directly declare the type variation).
uint32 type_variation_reference = 51;

message VarChar {
string value = 1;
uint32 length = 2;
Expand Down Expand Up @@ -428,6 +434,15 @@ message Expression {
// A homogeneously typed list of literals
repeated Literal values = 1;
}

message UserDefined {
// points to a type_anchor defined in this plan
uint32 type_reference = 1;

// the value of the literal, serialized using some type-specific
// protobuf message
google.protobuf.Any value = 2;
}
}

message ScalarFunction {
Expand Down

0 comments on commit 296c266

Please sign in to comment.