Skip to content

Commit

Permalink
fix: address review commends
Browse files Browse the repository at this point in the history
  • Loading branch information
richtia committed Feb 10, 2024
1 parent 6e2072d commit 7c5da20
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 44 deletions.
16 changes: 2 additions & 14 deletions proto/substrait/algebra.proto
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ message Expression {
string string = 12;
bytes binary = 13;
// Timestamp in units of microseconds since the UNIX epoch.
// Deprecated in favor of `PrecisionTimestamp precision_timestamp`
// Deprecated in favor of `precision_timestamp`
int64 timestamp = 14 [deprecated = true];
// Date in units of days since the UNIX epoch.
int32 date = 16;
Expand All @@ -815,7 +815,7 @@ message Expression {
Struct struct = 25;
Map map = 26;
// Timestamp in units of microseconds since the UNIX epoch.
// Deprecated in favor of `PrecisionTimestampTZ precision_timestamp_tz`
// Deprecated in favor of `precision_timestamp_tz`
int64 timestamp_tz = 27 [deprecated = true];
bytes uuid = 28;
Type null = 29; // a typed null literal
Expand Down Expand Up @@ -851,18 +851,6 @@ message Expression {
int32 scale = 3;
}

message PrecisionTimestamp {
// The maximum number of digits allowed in the value.
// Supported values are 0, 3, 6, and 9. The default is 6.
int32 precision = 1;
}

message PrecisionTimestampTZ {
// The maximum number of digits allowed in the value.
// Supported values are 0, 3, 6, and 9. The default is 6.
int32 precision = 1;
}

message Map {
message KeyValue {
Literal key = 1;
Expand Down
2 changes: 2 additions & 0 deletions proto/substrait/type.proto
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,14 @@ message Type {
}

message PrecisionTimestamp {
// Defaults to 6
optional int32 precision = 1;
uint32 type_variation_reference = 2;
Nullability nullability = 3;
}

message PrecisionTimestampTZ {
// Defaults to 6
optional int32 precision = 1;
uint32 type_variation_reference = 2;
Nullability nullability = 3;
Expand Down
58 changes: 30 additions & 28 deletions site/docs/extensions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,34 +58,36 @@ Rather than using a full data type representation, the input argument types (`sh

Every compound function signature must be unique. If two function implementations in a YAML file would generate the same compound function signature, then the YAML file is invalid and behavior is undefined.

| Argument Type | Signature Name |
| -------------------------- | -------------- |
| Required Enumeration | req |
| i8 | i8 |
| i16 | i16 |
| i32 | i32 |
| i64 | i64 |
| fp32 | fp32 |
| fp64 | fp64 |
| string | str |
| binary | vbin |
| boolean | bool |
| timestamp | ts |
| timestamp_tz | tstz |
| date | date |
| time | time |
| interval_year | iyear |
| interval_day | iday |
| uuid | uuid |
| fixedchar<N> | fchar |
| varchar<N> | vchar |
| fixedbinary<N> | fbin |
| decimal<P,S> | dec |
| struct<T1,T2,...,TN> | struct |
| list<T> | list |
| map<K,V> | map |
| any[\d]? | any |
| user defined type | u!name |
| Argument Type | Signature Name |
|---------------------------------|----------------|
| Required Enumeration | req |
| i8 | i8 |
| i16 | i16 |
| i32 | i32 |
| i64 | i64 |
| fp32 | fp32 |
| fp64 | fp64 |
| string | str |
| binary | vbin |
| boolean | bool |
| timestamp | ts |
| timestamp_tz | tstz |
| date | date |
| time | time |
| interval_year | iyear |
| interval_day | iday |
| uuid | uuid |
| fixedchar<N> | fchar |
| varchar<N> | vchar |
| fixedbinary<N> | fbin |
| decimal<P,S> | dec |
| precision_timestamp<P> | pts |
| precision_timestamp_tz<P> | ptstz |
| struct<T1,T2,...,TN> | struct |
| list<T> | list |
| map<K,V> | map |
| any[\d]? | any |
| user defined type | u!name |

#### Examples

Expand Down
4 changes: 2 additions & 2 deletions site/docs/types/type_classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ Compound type classes are type classes that need to be configured by means of a
| NSTRUCT<N:T1,...,N:Tn> | **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
| LIST<T> | A list of values of type T. The list can be between [0..2,147,483,647] values in length. | `repeated Literal`, all types matching T
| MAP<K, V> | An unordered list of type K keys with type V values. Keys may be repeated. While the key type could be nullable, keys may not be null. | `repeated KeyValue` (in turn two `Literal`s), all key types matching K and all value types matching V
| PRECISIONTIMESTAMP&lt;P&gt; | A timestamp with fractional second precision (P, number of digits) <= 9. Does not include timezone information and can thus not be unambiguously mapped to a moment on the timeline without context. Similar to naive datetime in Python. | `uint64` nanoseconds since 1970-01-01 00:00:00.000000000 (in an unspecified timezone)
| PRECISIONTIMESTAMPTZ&lt;P&gt; | A timezone-aware timestamp, with fractional second precision (P, number of digits) <= 9. Similar to aware datetime in Python. | `int64` microseconds since 1970-01-01 00:00:00.000000 UTC
| PRECISIONTIMESTAMP&lt;P&gt; | A timestamp with fractional second precision (P, number of digits) 0 >= P <= 9. Does not include timezone information and can thus not be unambiguously mapped to a moment on the timeline without context. Similar to naive datetime in Python. | `uint64` microseconds or nanorseconds since 1970-01-01 00:00:00.000000000 (in an unspecified timezone)
| PRECISIONTIMESTAMPTZ&lt;P&gt; | A timezone-aware timestamp, with fractional second precision (P, number of digits) 0 >= P <= 9. Similar to aware datetime in Python. | `uint64` microseconds or nanorseconds since 1970-01-01 00:00:00.000000000 UTC

## User-Defined Types

Expand Down

0 comments on commit 7c5da20

Please sign in to comment.