diff --git a/proto/substrait/algebra.proto b/proto/substrait/algebra.proto index 6a3730c2b..242c72869 100644 --- a/proto/substrait/algebra.proto +++ b/proto/substrait/algebra.proto @@ -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; @@ -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 @@ -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; diff --git a/proto/substrait/type.proto b/proto/substrait/type.proto index b5d3570c4..f2ca64665 100644 --- a/proto/substrait/type.proto +++ b/proto/substrait/type.proto @@ -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; diff --git a/site/docs/extensions/index.md b/site/docs/extensions/index.md index 0d4ae606a..b35dc68db 100644 --- a/site/docs/extensions/index.md +++ b/site/docs/extensions/index.md @@ -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 diff --git a/site/docs/types/type_classes.md b/site/docs/types/type_classes.md index 56c063dd8..c912610a5 100644 --- a/site/docs/types/type_classes.md +++ b/site/docs/types/type_classes.md @@ -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<P> | 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<P> | 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<P> | 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<P> | 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