From 0e5b190f7b3c50c810fe0ea2420084e4f72ab40a Mon Sep 17 00:00:00 2001 From: Yun Zou Date: Tue, 27 May 2025 23:58:28 -0700 Subject: [PATCH 01/16] add spec --- LogicalTypes.md | 19 ++++++++++++++++++- src/main/thrift/parquet.thrift | 27 +++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/LogicalTypes.md b/LogicalTypes.md index e7a0ce046..c2e7ff9db 100644 --- a/LogicalTypes.md +++ b/LogicalTypes.md @@ -521,7 +521,11 @@ as shown below. -### INTERVAL +### INTERVAL types + +#### INTERVAL +`INTERVAL` is *deprecated*. Please use `INTERVAL_YEAR_MONTH` and `INTERVAL_DAY_TIME` +as a more precise representation per [ANSI SQL Standard](https://www.ibm.com/docs/en/informix-servers/14.10.0?topic=types-ansi-sql-standards-datetime-interval-values). `INTERVAL` is used for an interval of time. It must annotate a `fixed_len_byte_array` of length 12. This array stores three little-endian @@ -539,6 +543,19 @@ The sort order used for `INTERVAL` is undefined. When writing data, no min/max statistics should be saved for this type and if such non-compliant statistics are found during reading, they must be ignored. +#### INTERVAL_YEAR_MONTH +`INTERVAL_YEAR_MONTH` is used to represent a year-month time interval, such as +`4 years and 6 months`. It must annotate an `int32` that stores the total number +of months as a signed integer, which represents the interval and can be negative. +The time duration is independent of any timezone. + +#### INTERVAL_DAY_TIME +`INTERVAL_DAY_TIME` is used to represent a day-time time interval, such as +`5 days, 10 hours and 30 minutes`. It must annotate and 16-byte `FIXED_LEN_BYTE_ARRAY` +that stores the total number of nanoseconds representing the interval. The value is +a signed integer and can be negative to indicate backward duration. +The time interval is independent of any timezone. + ## Embedded Types Embedded types do not have type-specific orderings. diff --git a/src/main/thrift/parquet.thrift b/src/main/thrift/parquet.thrift index 59ec5f171..c7ff75e14 100644 --- a/src/main/thrift/parquet.thrift +++ b/src/main/thrift/parquet.thrift @@ -461,6 +461,29 @@ struct GeographyType { 2: optional EdgeInterpolationAlgorithm algorithm; } +/** + * Year-Month Interval logical type annotation + * + * The data is stored as an 4 byte signed integer which represents the number + * of months associated with the time interval. The value can be negative to + * indicate a backward duration. + * + * Allowed for physical type: INT32 + */ +struct IntervalYearMonthType { +} + +/** + * Month-Day Interval logical type annotation + * + * The data is stored as a 16-byte signed value, which represents the number + * of nanoseconds. The value can be negative to indicate a backward duration. + * + * Allowed for physical type: FIXED_LEN_BYTE_ARRAY + */ +struct IntervalMonthDayType { +} + /** * LogicalType annotations to replace ConvertedType. * @@ -494,6 +517,10 @@ union LogicalType { 16: VariantType VARIANT // no compatible ConvertedType 17: GeometryType GEOMETRY // no compatible ConvertedType 18: GeographyType GEOGRAPHY // no compatible ConvertedType + + // INTERVAL types + 19: IntervalYearMonthType INTERVAL_YEAR_MONTH // no compatible convertedType + 20: IntervalDayTimeType INTERVAL_DAY_TIME // no compatible convertedType } /** From 81aa637f7649d79a51826fe89faebbe6eb16a260 Mon Sep 17 00:00:00 2001 From: Yun Zou Date: Wed, 28 May 2025 18:41:06 -0700 Subject: [PATCH 02/16] address comments --- LogicalTypes.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/LogicalTypes.md b/LogicalTypes.md index c2e7ff9db..b372a9575 100644 --- a/LogicalTypes.md +++ b/LogicalTypes.md @@ -551,11 +551,16 @@ The time duration is independent of any timezone. #### INTERVAL_DAY_TIME `INTERVAL_DAY_TIME` is used to represent a day-time time interval, such as -`5 days, 10 hours and 30 minutes`. It must annotate and 16-byte `FIXED_LEN_BYTE_ARRAY` +`5 days, 10 hours and 30 minutes`. It must annotate a 16-byte `FIXED_LEN_BYTE_ARRAY` that stores the total number of nanoseconds representing the interval. The value is a signed integer and can be negative to indicate backward duration. The time interval is independent of any timezone. +Based on the [ANSI SQL standard](https://web.cecs.pdx.edu/~len/sql1999.pdf) definition of the INTERVAL data type and fields values, +an interval of 1 day is equivalent to 24 hours, regardless of the specific number of +seconds in a day. This means that when you define an interval of `1 day`, +it represents exactly 24 hours, or 86,400,000,000 nanoseconds. + ## Embedded Types Embedded types do not have type-specific orderings. From 270d7ef8f21e201b66dc890dbac90f3057c6f0a4 Mon Sep 17 00:00:00 2001 From: Yun Zou Date: Wed, 28 May 2025 18:56:39 -0700 Subject: [PATCH 03/16] address feedback --- LogicalTypes.md | 8 +++++--- src/main/thrift/parquet.thrift | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/LogicalTypes.md b/LogicalTypes.md index b372a9575..0ad5d55ce 100644 --- a/LogicalTypes.md +++ b/LogicalTypes.md @@ -521,11 +521,11 @@ as shown below. -### INTERVAL types +### Interval types #### INTERVAL `INTERVAL` is *deprecated*. Please use `INTERVAL_YEAR_MONTH` and `INTERVAL_DAY_TIME` -as a more precise representation per [ANSI SQL Standard](https://www.ibm.com/docs/en/informix-servers/14.10.0?topic=types-ansi-sql-standards-datetime-interval-values). +as a more precise representation per [ANSI SQL Standard](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Data-Types.html#GUID-7690645A-0EE3-46CA-90DE-C96DF5A01F8F). `INTERVAL` is used for an interval of time. It must annotate a `fixed_len_byte_array` of length 12. This array stores three little-endian @@ -544,19 +544,21 @@ statistics should be saved for this type and if such non-compliant statistics are found during reading, they must be ignored. #### INTERVAL_YEAR_MONTH + `INTERVAL_YEAR_MONTH` is used to represent a year-month time interval, such as `4 years and 6 months`. It must annotate an `int32` that stores the total number of months as a signed integer, which represents the interval and can be negative. The time duration is independent of any timezone. #### INTERVAL_DAY_TIME + `INTERVAL_DAY_TIME` is used to represent a day-time time interval, such as `5 days, 10 hours and 30 minutes`. It must annotate a 16-byte `FIXED_LEN_BYTE_ARRAY` that stores the total number of nanoseconds representing the interval. The value is a signed integer and can be negative to indicate backward duration. The time interval is independent of any timezone. -Based on the [ANSI SQL standard](https://web.cecs.pdx.edu/~len/sql1999.pdf) definition of the INTERVAL data type and fields values, +Based on the [ANSI SQL standard](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Data-Types.html#GUID-7690645A-0EE3-46CA-90DE-C96DF5A01F8F) definition of the INTERVAL data type and fields values, an interval of 1 day is equivalent to 24 hours, regardless of the specific number of seconds in a day. This means that when you define an interval of `1 day`, it represents exactly 24 hours, or 86,400,000,000 nanoseconds. diff --git a/src/main/thrift/parquet.thrift b/src/main/thrift/parquet.thrift index c7ff75e14..af2848aa6 100644 --- a/src/main/thrift/parquet.thrift +++ b/src/main/thrift/parquet.thrift @@ -1098,6 +1098,8 @@ union ColumnOrder { * VARIANT - undefined * GEOMETRY - undefined * GEOGRAPHY - undefined + * INTERVAL_YEAR_MONTH - signed comparison of the represented value + * INTERVAL_DAY_TIME - signed comparison of the represented value * * In the absence of logical types, the sort order is determined by the physical type: * BOOLEAN - false, true From f3a6863f8b39e5cede91aab5a278e576cf396494 Mon Sep 17 00:00:00 2001 From: Yun Zou Date: Wed, 28 May 2025 18:57:38 -0700 Subject: [PATCH 04/16] add new line --- LogicalTypes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/LogicalTypes.md b/LogicalTypes.md index 0ad5d55ce..3cf1744d8 100644 --- a/LogicalTypes.md +++ b/LogicalTypes.md @@ -524,6 +524,7 @@ as shown below. ### Interval types #### INTERVAL + `INTERVAL` is *deprecated*. Please use `INTERVAL_YEAR_MONTH` and `INTERVAL_DAY_TIME` as a more precise representation per [ANSI SQL Standard](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Data-Types.html#GUID-7690645A-0EE3-46CA-90DE-C96DF5A01F8F). From d4068da5b5e487e223f86cde2bdb6eda6f45efdc Mon Sep 17 00:00:00 2001 From: Yun Zou Date: Mon, 23 Jun 2025 11:24:31 -0700 Subject: [PATCH 05/16] fix type name --- src/main/thrift/parquet.thrift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/thrift/parquet.thrift b/src/main/thrift/parquet.thrift index af2848aa6..f2d69cdf1 100644 --- a/src/main/thrift/parquet.thrift +++ b/src/main/thrift/parquet.thrift @@ -481,7 +481,7 @@ struct IntervalYearMonthType { * * Allowed for physical type: FIXED_LEN_BYTE_ARRAY */ -struct IntervalMonthDayType { +struct IntervalDayTimeType { } /** From cee153d62a15ebd5dbb172ecb4b40ad2f39031aa Mon Sep 17 00:00:00 2001 From: Yun Zou Date: Mon, 23 Jun 2025 17:41:48 -0700 Subject: [PATCH 06/16] add change --- src/main/thrift/parquet.thrift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/thrift/parquet.thrift b/src/main/thrift/parquet.thrift index f2d69cdf1..8608f38a8 100644 --- a/src/main/thrift/parquet.thrift +++ b/src/main/thrift/parquet.thrift @@ -474,10 +474,10 @@ struct IntervalYearMonthType { } /** - * Month-Day Interval logical type annotation + * Day-Time Interval logical type annotation * - * The data is stored as a 16-byte signed value, which represents the number - * of nanoseconds. The value can be negative to indicate a backward duration. + * The data is stored as a 16-byte signed little endian value, which represents the + * number of nanoseconds. The value can be negative to indicate a backward duration. * * Allowed for physical type: FIXED_LEN_BYTE_ARRAY */ From c57e3707b4d5476fafc08f5df23c890861b86ce8 Mon Sep 17 00:00:00 2001 From: Yun Zou Date: Mon, 23 Jun 2025 17:47:25 -0700 Subject: [PATCH 07/16] address comments --- src/main/thrift/parquet.thrift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/thrift/parquet.thrift b/src/main/thrift/parquet.thrift index 8608f38a8..e9fdd99ce 100644 --- a/src/main/thrift/parquet.thrift +++ b/src/main/thrift/parquet.thrift @@ -480,6 +480,9 @@ struct IntervalYearMonthType { * number of nanoseconds. The value can be negative to indicate a backward duration. * * Allowed for physical type: FIXED_LEN_BYTE_ARRAY + * + * For example, 5 days 2 seconds are 434,000,000,000,000 nanoseconds in total, the + * final 16-byte FIXED_LEN_BYTE_ARRAY hex will be 00000000000000000010a36c948c0000. */ struct IntervalDayTimeType { } From 219668971cb06cf90f4d613e2c9bb0fb37ac10df Mon Sep 17 00:00:00 2001 From: Yun Zou Date: Fri, 25 Jul 2025 09:51:41 -0700 Subject: [PATCH 08/16] update changes --- LogicalTypes.md | 20 +++++++++++--------- src/main/thrift/parquet.thrift | 18 ++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/LogicalTypes.md b/LogicalTypes.md index 3cf1744d8..f36d5451c 100644 --- a/LogicalTypes.md +++ b/LogicalTypes.md @@ -525,7 +525,7 @@ as shown below. #### INTERVAL -`INTERVAL` is *deprecated*. Please use `INTERVAL_YEAR_MONTH` and `INTERVAL_DAY_TIME` +`INTERVAL` is *deprecated*. Please use `YEAR_MONTH_INTERVAL` and `DURATION` as a more precise representation per [ANSI SQL Standard](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Data-Types.html#GUID-7690645A-0EE3-46CA-90DE-C96DF5A01F8F). `INTERVAL` is used for an interval of time. It must annotate a @@ -544,23 +544,25 @@ The sort order used for `INTERVAL` is undefined. When writing data, no min/max statistics should be saved for this type and if such non-compliant statistics are found during reading, they must be ignored. -#### INTERVAL_YEAR_MONTH +#### YEAR_MONTH_INTERVAL -`INTERVAL_YEAR_MONTH` is used to represent a year-month time interval, such as +`YEAR_MONTH_INTERVAL` is used to represent a year-month time interval, such as `4 years and 6 months`. It must annotate an `int32` that stores the total number of months as a signed integer, which represents the interval and can be negative. The time duration is independent of any timezone. -#### INTERVAL_DAY_TIME +#### DURATION -`INTERVAL_DAY_TIME` is used to represent a day-time time interval, such as -`5 days, 10 hours and 30 minutes`. It must annotate a 16-byte `FIXED_LEN_BYTE_ARRAY` -that stores the total number of nanoseconds representing the interval. The value is +`DURATION` is used to represent a day-time time interval, such as +`5 days, 10 hours and 30 minutes`. It must annotate an `int64` +that stores the total number of time units representing the interval. The value is a signed integer and can be negative to indicate backward duration. The time interval is independent of any timezone. -Based on the [ANSI SQL standard](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Data-Types.html#GUID-7690645A-0EE3-46CA-90DE-C96DF5A01F8F) definition of the INTERVAL data type and fields values, -an interval of 1 day is equivalent to 24 hours, regardless of the specific number of +The `DURATION` type takes `unit` as a parameter, and the value must be one of +`MILLIS`, `MICROS` or `NANOS`. + +Interval of 1 day is equivalent to 24 hours, regardless of the specific number of seconds in a day. This means that when you define an interval of `1 day`, it represents exactly 24 hours, or 86,400,000,000 nanoseconds. diff --git a/src/main/thrift/parquet.thrift b/src/main/thrift/parquet.thrift index e9fdd99ce..3b2c129d6 100644 --- a/src/main/thrift/parquet.thrift +++ b/src/main/thrift/parquet.thrift @@ -470,21 +470,19 @@ struct GeographyType { * * Allowed for physical type: INT32 */ -struct IntervalYearMonthType { +struct YEAR_MONTH_INTERVAL { } /** * Day-Time Interval logical type annotation * - * The data is stored as a 16-byte signed little endian value, which represents the - * number of nanoseconds. The value can be negative to indicate a backward duration. + * The data is stored as a 8-byte signed integer which represents the number of + * total time units. The value can be negative to indicate a backward duration. * - * Allowed for physical type: FIXED_LEN_BYTE_ARRAY - * - * For example, 5 days 2 seconds are 434,000,000,000,000 nanoseconds in total, the - * final 16-byte FIXED_LEN_BYTE_ARRAY hex will be 00000000000000000010a36c948c0000. + * Allowed for physical type: INT64 */ -struct IntervalDayTimeType { +struct DurationType { + 1: required TimeUnit unit } /** @@ -522,8 +520,8 @@ union LogicalType { 18: GeographyType GEOGRAPHY // no compatible ConvertedType // INTERVAL types - 19: IntervalYearMonthType INTERVAL_YEAR_MONTH // no compatible convertedType - 20: IntervalDayTimeType INTERVAL_DAY_TIME // no compatible convertedType + 19: YearMonthIntervalType YEAR_MONTH_INTERVAL // no compatible convertedType + 20: DurationType DURATION // no compatible convertedType } /** From 85bd7d226c4d03208c1e9c8149af355b000f98dc Mon Sep 17 00:00:00 2001 From: Yun Zou Date: Fri, 25 Jul 2025 10:00:06 -0700 Subject: [PATCH 09/16] update description --- LogicalTypes.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/LogicalTypes.md b/LogicalTypes.md index f36d5451c..7e2dbdba4 100644 --- a/LogicalTypes.md +++ b/LogicalTypes.md @@ -553,18 +553,17 @@ The time duration is independent of any timezone. #### DURATION -`DURATION` is used to represent a day-time time interval, such as -`5 days, 10 hours and 30 minutes`. It must annotate an `int64` -that stores the total number of time units representing the interval. The value is -a signed integer and can be negative to indicate backward duration. -The time interval is independent of any timezone. +`DURATION` is used to represent a span of time, such as `5 days`. It must +annotate an `int64` value that stores the total number of time units for the +duration. The value is a signed integer and can be negative to indicate backward duration. +The duration is purely a measure of time and is independent of any time zone. The `DURATION` type takes `unit` as a parameter, and the value must be one of `MILLIS`, `MICROS` or `NANOS`. -Interval of 1 day is equivalent to 24 hours, regardless of the specific number of -seconds in a day. This means that when you define an interval of `1 day`, -it represents exactly 24 hours, or 86,400,000,000 nanoseconds. +Duration of 1 day is defined exactly of 24 hours, regardless of the specific number of +seconds in a calendar day. For example, a 1-day duration is always equal to +86,400,000,000 nanoseconds. ## Embedded Types From 8b76121ee7b1cfebac7fe30b74e647ffad9ca4a3 Mon Sep 17 00:00:00 2001 From: Yun Zou Date: Fri, 25 Jul 2025 10:01:30 -0700 Subject: [PATCH 10/16] fix description --- src/main/thrift/parquet.thrift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/thrift/parquet.thrift b/src/main/thrift/parquet.thrift index 3b2c129d6..d3d875a92 100644 --- a/src/main/thrift/parquet.thrift +++ b/src/main/thrift/parquet.thrift @@ -1099,8 +1099,8 @@ union ColumnOrder { * VARIANT - undefined * GEOMETRY - undefined * GEOGRAPHY - undefined - * INTERVAL_YEAR_MONTH - signed comparison of the represented value - * INTERVAL_DAY_TIME - signed comparison of the represented value + * YEAR_MONTH_INTERVAL - signed comparison of the represented value + * DURATION - signed comparison of the represented value * * In the absence of logical types, the sort order is determined by the physical type: * BOOLEAN - false, true From fcb6b8bce9041f73a7334f8972c1968eae2176fd Mon Sep 17 00:00:00 2001 From: Yun Zou Date: Fri, 25 Jul 2025 10:07:37 -0700 Subject: [PATCH 11/16] fix type name --- src/main/thrift/parquet.thrift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/thrift/parquet.thrift b/src/main/thrift/parquet.thrift index d3d875a92..05abf18ec 100644 --- a/src/main/thrift/parquet.thrift +++ b/src/main/thrift/parquet.thrift @@ -470,7 +470,7 @@ struct GeographyType { * * Allowed for physical type: INT32 */ -struct YEAR_MONTH_INTERVAL { +struct YearMonthIntervalType { } /** From f72554f013e77518f605b445ef5b836e2cfc9599 Mon Sep 17 00:00:00 2001 From: Yun Zou Date: Sun, 27 Jul 2025 21:54:18 -0700 Subject: [PATCH 12/16] address comments --- LogicalTypes.md | 10 +++++++--- src/main/thrift/parquet.thrift | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/LogicalTypes.md b/LogicalTypes.md index 7e2dbdba4..3bb1b9673 100644 --- a/LogicalTypes.md +++ b/LogicalTypes.md @@ -549,7 +549,10 @@ are found during reading, they must be ignored. `YEAR_MONTH_INTERVAL` is used to represent a year-month time interval, such as `4 years and 6 months`. It must annotate an `int32` that stores the total number of months as a signed integer, which represents the interval and can be negative. -The time duration is independent of any timezone. + +While ANSI SQL systems typically restrict supported intervals to a range of ±10,000 +years and enforce this constraint internally, the Parquet format does not impose +any limitations on the interval values that may be stored. #### DURATION @@ -561,8 +564,9 @@ The duration is purely a measure of time and is independent of any time zone. The `DURATION` type takes `unit` as a parameter, and the value must be one of `MILLIS`, `MICROS` or `NANOS`. -Duration of 1 day is defined exactly of 24 hours, regardless of the specific number of -seconds in a calendar day. For example, a 1-day duration is always equal to +`Duration` can be used to represent DayTime Intervals as defined by ANSI SQL. In this +context, a duration of 1 day is strictly defined as 24 hours, regardless of the actual +number of hours in a calendar day. For example, a 1-day duration is always equal to 86,400,000,000 nanoseconds. ## Embedded Types diff --git a/src/main/thrift/parquet.thrift b/src/main/thrift/parquet.thrift index 05abf18ec..4c60ea212 100644 --- a/src/main/thrift/parquet.thrift +++ b/src/main/thrift/parquet.thrift @@ -474,7 +474,7 @@ struct YearMonthIntervalType { } /** - * Day-Time Interval logical type annotation + * Duration logical type annotation * * The data is stored as a 8-byte signed integer which represents the number of * total time units. The value can be negative to indicate a backward duration. From eeedd5be788e5a3543bbbc8f1a5fb769b18abf02 Mon Sep 17 00:00:00 2001 From: Yun Zou Date: Sun, 27 Jul 2025 21:55:38 -0700 Subject: [PATCH 13/16] fix format --- LogicalTypes.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/LogicalTypes.md b/LogicalTypes.md index 3bb1b9673..b2cbfbabc 100644 --- a/LogicalTypes.md +++ b/LogicalTypes.md @@ -550,16 +550,16 @@ are found during reading, they must be ignored. `4 years and 6 months`. It must annotate an `int32` that stores the total number of months as a signed integer, which represents the interval and can be negative. -While ANSI SQL systems typically restrict supported intervals to a range of ±10,000 -years and enforce this constraint internally, the Parquet format does not impose +While ANSI SQL systems typically restrict supported intervals to a range of ±10,000 years +and enforce this constraint internally, the Parquet format does not impose any limitations on the interval values that may be stored. #### DURATION `DURATION` is used to represent a span of time, such as `5 days`. It must annotate an `int64` value that stores the total number of time units for the -duration. The value is a signed integer and can be negative to indicate backward duration. -The duration is purely a measure of time and is independent of any time zone. +duration. The value is a signed integer and can be negative to indicate backward +duration. The duration is purely a measure of time and is independent of any time zone. The `DURATION` type takes `unit` as a parameter, and the value must be one of `MILLIS`, `MICROS` or `NANOS`. From fa770f82413418067d73afcd0270cb4607712d46 Mon Sep 17 00:00:00 2001 From: Yun Zou Date: Sun, 27 Jul 2025 21:56:49 -0700 Subject: [PATCH 14/16] add more comments --- LogicalTypes.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/LogicalTypes.md b/LogicalTypes.md index b2cbfbabc..2af759166 100644 --- a/LogicalTypes.md +++ b/LogicalTypes.md @@ -550,9 +550,9 @@ are found during reading, they must be ignored. `4 years and 6 months`. It must annotate an `int32` that stores the total number of months as a signed integer, which represents the interval and can be negative. -While ANSI SQL systems typically restrict supported intervals to a range of ±10,000 years -and enforce this constraint internally, the Parquet format does not impose -any limitations on the interval values that may be stored. +While ANSI SQL systems typically restrict supported intervals to a range of +±10,000 years and enforce this constraint internally, the Parquet format +does not impose any limitations on the interval values that may be stored. #### DURATION @@ -564,10 +564,9 @@ duration. The duration is purely a measure of time and is independent of any tim The `DURATION` type takes `unit` as a parameter, and the value must be one of `MILLIS`, `MICROS` or `NANOS`. -`Duration` can be used to represent DayTime Intervals as defined by ANSI SQL. In this -context, a duration of 1 day is strictly defined as 24 hours, regardless of the actual -number of hours in a calendar day. For example, a 1-day duration is always equal to -86,400,000,000 nanoseconds. +`Duration` can be used to represent DayTime Intervals as defined by ANSI SQL. In +this context, a duration of 1 day is strictly defined as 24 hours, regardless of +the actual number of hours in a calendar day. ## Embedded Types From 7be055542f4de3205c3bf5f40866e36f2aac9283 Mon Sep 17 00:00:00 2001 From: Yun Zou Date: Mon, 28 Jul 2025 10:35:24 -0700 Subject: [PATCH 15/16] address comments --- LogicalTypes.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/LogicalTypes.md b/LogicalTypes.md index 2af759166..f38fcdd1a 100644 --- a/LogicalTypes.md +++ b/LogicalTypes.md @@ -558,8 +558,9 @@ does not impose any limitations on the interval values that may be stored. `DURATION` is used to represent a span of time, such as `5 days`. It must annotate an `int64` value that stores the total number of time units for the -duration. The value is a signed integer and can be negative to indicate backward -duration. The duration is purely a measure of time and is independent of any time zone. +duration. The value is a signed integer, where a negative value indicates the +duration is in the reverse (backward) direction. The duration is purely a +measure of time and is independent of any time zone. The `DURATION` type takes `unit` as a parameter, and the value must be one of `MILLIS`, `MICROS` or `NANOS`. From 37df43f826a033b5197ece3eddc2995f3c432e27 Mon Sep 17 00:00:00 2001 From: Yun Zou Date: Mon, 28 Jul 2025 10:39:48 -0700 Subject: [PATCH 16/16] update decision --- LogicalTypes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LogicalTypes.md b/LogicalTypes.md index f38fcdd1a..838b7daed 100644 --- a/LogicalTypes.md +++ b/LogicalTypes.md @@ -559,8 +559,8 @@ does not impose any limitations on the interval values that may be stored. `DURATION` is used to represent a span of time, such as `5 days`. It must annotate an `int64` value that stores the total number of time units for the duration. The value is a signed integer, where a negative value indicates the -duration is in the reverse (backward) direction. The duration is purely a -measure of time and is independent of any time zone. +duration moves backward in time (e.g., -5 days means going backward for 5 days). +The duration is purely a measure of time and is independent of any time zone. The `DURATION` type takes `unit` as a parameter, and the value must be one of `MILLIS`, `MICROS` or `NANOS`.