Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions proto/substrait/algebra.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,7 @@ message Expression {
string fixed_char = 21;
VarChar var_char = 22;
bytes fixed_binary = 23;
bytes var_binary = 38;
Decimal decimal = 24;
// Time in precision units past midnight.
PrecisionTime precision_time = 37;
Expand Down
7 changes: 7 additions & 0 deletions proto/substrait/type.proto
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ message Type {
FixedChar fixed_char = 21;
VarChar varchar = 22;
FixedBinary fixed_binary = 23;
VarBinary var_binary = 37;
Decimal decimal = 24;
PrecisionTime precision_time = 36;
PrecisionTimestamp precision_timestamp = 33;
Expand Down Expand Up @@ -173,6 +174,12 @@ message Type {
Nullability nullability = 3;
}

message VarBinary {
int32 length = 1;
uint32 type_variation_reference = 2;
Nullability nullability = 3;
}

message Decimal {
int32 scale = 1;
int32 precision = 2;
Expand Down
1 change: 1 addition & 0 deletions site/docs/types/type_classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Compound type classes are type classes that need to be configured by means of a
| FIXEDCHAR<L> | A fixed-length unicode string of L characters. L must be within [1..2,147,483,647]. | L-character `string`
| VARCHAR<L> | A unicode string of at most L characters.L must be within [1..2,147,483,647]. | `string` with at most L characters
| FIXEDBINARY<L> | A binary string of L bytes. When casting, values shorter than L are padded with zeros, and values longer than L are right-trimmed. | L-byte `bytes`
| VARBINARY<L> | A binary string of L bytes. L must be within [1..2,147,483,647]. When casting, values longer than L are right-trimmed. | byte `bytes` with at most L bytes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea clarifying the CAST behaviour. As you point out, this can be system dependent.

| DECIMAL&lt;P, S&gt; | A fixed-precision decimal value having precision (P, number of digits) <= 38 and scale (S, number of fractional digits) 0 <= S <= P. | 16-byte `bytes` representing a little-endian 128-bit integer, to be divided by 10^S to get the decimal value
| STRUCT&lt;T1,...,Tn&gt; | A list of types in a defined order. | `repeated Literal`, types matching T1..Tn
| NSTRUCT&lt;N:T1,...,N:Tn&gt; | **Pseudo-type**: A struct that maps unique names to value types. Each name is a UTF-8-encoded string. Each value can have a distinct type. Note that NSTRUCT is actually a pseudo-type, because Substrait's core type system is based entirely on ordinal positions, not named fields. Nonetheless, when working with systems outside Substrait, names are important. | n/a
Expand Down
Loading