From dfd1ca0fbf62a60c4b7448ab78565de20097e655 Mon Sep 17 00:00:00 2001 From: Victor Barua Date: Fri, 19 Jul 2024 07:46:50 -0700 Subject: [PATCH] feat: add precision timestamp datetime fn variants --- extensions/functions_datetime.yaml | 239 ++++++++++++++++++++++++++++- 1 file changed, 235 insertions(+), 4 deletions(-) diff --git a/extensions/functions_datetime.yaml b/extensions/functions_datetime.yaml index 0d575b5dd..cde3beb68 100644 --- a/extensions/functions_datetime.yaml +++ b/extensions/functions_datetime.yaml @@ -83,7 +83,7 @@ scalar_functions: MILLISECOND, MICROSECOND, NANOSECOND, SUBSECOND, UNIX_TIME, TIMEZONE_OFFSET ] description: The part of the value to extract. - name: x - value: precision_timestamp_tz + value: precision_timestamp_tz

- name: timezone description: Timezone string from IANA tzdb. value: string @@ -102,7 +102,7 @@ scalar_functions: MILLISECOND, MICROSECOND, NANOSECOND, SUBSECOND, UNIX_TIME ] description: The part of the value to extract. - name: x - value: precision_timestamp + value: precision_timestamp

return: i64 - args: - name: component @@ -141,7 +141,7 @@ scalar_functions: options: [ ONE, ZERO ] description: Start counting from 1 or 0. - name: x - value: precision_timestamp_tz + value: precision_timestamp_tz

- name: timezone description: Timezone string from IANA tzdb. value: string @@ -166,7 +166,7 @@ scalar_functions: options: [ ONE, ZERO ] description: Start counting from 1 or 0. - name: x - value: precision_timestamp + value: precision_timestamp

return: i64 - args: - name: component @@ -198,6 +198,13 @@ scalar_functions: - name: x value: timestamp return: boolean + - args: + - name: component + options: [ IS_LEAP_YEAR ] + description: The part of the value to extract. + - name: x + value: precision_timestamp

+ return: boolean - args: - name: component options: [ IS_LEAP_YEAR, IS_DST ] @@ -208,6 +215,16 @@ scalar_functions: description: Timezone string from IANA tzdb. value: string return: boolean + - args: + - name: component + options: [ IS_LEAP_YEAR, IS_DST ] + description: The part of the value to extract. + - name: x + value: precision_timestamp_tz

+ - name: timezone + description: Timezone string from IANA tzdb. + value: string + return: boolean - args: - name: component options: [ IS_LEAP_YEAR ] @@ -230,6 +247,12 @@ scalar_functions: - name: y value: interval_year return: timestamp + - args: + - name: x + value: precision_timestamp

+ - name: y + value: interval_year + return: precision_timestamp

- args: - name: x value: timestamp_tz @@ -239,6 +262,15 @@ scalar_functions: description: Timezone string from IANA tzdb. value: string return: timestamp_tz + - args: + - name: x + value: precision_timestamp_tz

+ - name: y + value: interval_year + - name: timezone + description: Timezone string from IANA tzdb. + value: string + return: precision_timestamp_tz

- args: - name: x value: date @@ -251,12 +283,24 @@ scalar_functions: - name: y value: interval_day return: timestamp + - args: + - name: x + value: precision_timestamp

+ - name: y + value: interval_day + return: precision_timestamp

- args: - name: x value: timestamp_tz - name: y value: interval_day return: timestamp_tz + - args: + - name: x + value: precision_timestamp_tz

+ - name: y + value: interval_day + return: precision_timestamp_tz

- args: - name: x value: date @@ -346,12 +390,24 @@ scalar_functions: - name: y value: interval_year return: timestamp + - args: + - name: x + value: precision_timestamp

+ - name: y + value: interval_year + return: precision_timestamp

- args: - name: x value: timestamp_tz - name: y value: interval_year return: timestamp_tz + - args: + - name: x + value: precision_timestamp_tz

+ - name: y + value: interval_year + return: precision_timestamp_tz

- args: - name: x value: timestamp_tz @@ -361,6 +417,15 @@ scalar_functions: description: Timezone string from IANA tzdb. value: string return: timestamp_tz + - args: + - name: x + value: precision_timestamp_tz

+ - name: y + value: interval_year + - name: timezone + description: Timezone string from IANA tzdb. + value: string + return: precision_timestamp_tz

- args: - name: x value: date @@ -373,12 +438,24 @@ scalar_functions: - name: y value: interval_day return: timestamp + - args: + - name: x + value: precision_timestamp

+ - name: y + value: interval_day + return: precision_timestamp

- args: - name: x value: timestamp_tz - name: y value: interval_day return: timestamp_tz + - args: + - name: x + value: precision_timestamp_tz

+ - name: y + value: interval_day + return: precision_timestamp_tz

- args: - name: x value: date @@ -395,12 +472,24 @@ scalar_functions: - name: y value: timestamp return: boolean + - args: + - name: x + value: precision_timestamp

+ - name: y + value: precision_timestamp

+ return: boolean - args: - name: x value: timestamp_tz - name: y value: timestamp_tz return: boolean + - args: + - name: x + value: precision_timestamp_tz

+ - name: y + value: precision_timestamp_tz

+ return: boolean - args: - name: x value: date @@ -429,12 +518,24 @@ scalar_functions: - name: y value: timestamp return: boolean + - args: + - name: x + value: precision_timestamp

+ - name: y + value: precision_timestamp

+ return: boolean - args: - name: x value: timestamp_tz - name: y value: timestamp_tz return: boolean + - args: + - name: x + value: precision_timestamp_tz

+ - name: y + value: precision_timestamp_tz

+ return: boolean - args: - name: x value: date @@ -463,12 +564,24 @@ scalar_functions: - name: y value: timestamp return: boolean + - args: + - name: x + value: precision_timestamp

+ - name: y + value: precision_timestamp

+ return: boolean - args: - name: x value: timestamp_tz - name: y value: timestamp_tz return: boolean + - args: + - name: x + value: precision_timestamp_tz

+ - name: y + value: precision_timestamp_tz

+ return: boolean - args: - name: x value: date @@ -497,12 +610,24 @@ scalar_functions: - name: y value: timestamp return: boolean + - args: + - name: x + value: precision_timestamp

+ - name: y + value: precision_timestamp

+ return: boolean - args: - name: x value: timestamp_tz - name: y value: timestamp_tz return: boolean + - args: + - name: x + value: precision_timestamp_tz

+ - name: y + value: precision_timestamp_tz

+ return: boolean - args: - name: x value: date @@ -537,6 +662,13 @@ scalar_functions: description: Timezone string from IANA tzdb. value: string return: timestamp_tz + - args: + - name: x + value: precision_timestamp

+ - name: timezone + description: Timezone string from IANA tzdb. + value: string + return: precision_timestamp_tz

- args: - name: x value: date @@ -560,6 +692,13 @@ scalar_functions: description: Timezone string from IANA tzdb. value: string return: timestamp + - args: + - name: x + value: precision_timestamp_tz

+ - name: timezone + description: Timezone string from IANA tzdb. + value: string + return: precision_timestamp

- name: "strptime_time" description: >- @@ -627,6 +766,12 @@ scalar_functions: - name: format value: string return: string + - args: + - name: x + value: precision_timestamp

+ - name: format + value: string + return: string - args: - name: x value: timestamp_tz @@ -636,6 +781,15 @@ scalar_functions: description: Timezone string from IANA tzdb. value: string return: string + - args: + - name: x + value: precision_timestamp_tz

+ - name: format + value: string + - name: timezone + description: Timezone string from IANA tzdb. + value: string + return: string - args: - name: x value: date @@ -674,6 +828,18 @@ scalar_functions: - name: origin value: timestamp return: timestamp + - args: + - name: x + value: precision_timestamp

+ - name: rounding + options: [ FLOOR, CEIL, ROUND_TIE_DOWN, ROUND_TIE_UP ] + - name: unit + options: [ YEAR, MONTH, WEEK, DAY, HOUR, MINUTE, SECOND, MILLISECOND, MICROSECOND ] + - name: multiple + value: i64 + - name: origin + value: precision_timestamp

+ return: precision_timestamp

- args: - name: x value: timestamp_tz @@ -689,6 +855,21 @@ scalar_functions: - name: origin value: timestamp_tz return: timestamp_tz + - args: + - name: x + value: precision_timestamp_tz

+ - name: rounding + options: [ FLOOR, CEIL, ROUND_TIE_DOWN, ROUND_TIE_UP ] + - name: unit + options: [ YEAR, MONTH, WEEK, DAY, HOUR, MINUTE, SECOND, MILLISECOND, MICROSECOND ] + - name: multiple + value: i64 + - name: timezone + description: Timezone string from IANA tzdb. + value: string + - name: origin + value: precision_timestamp_tz

+ return: precision_timestamp_tz

- args: - name: x value: date @@ -741,6 +922,19 @@ scalar_functions: - name: multiple value: i64 return: timestamp + - args: + - name: x + value: precision_timestamp

+ - name: rounding + options: [ FLOOR, CEIL, ROUND_TIE_DOWN, ROUND_TIE_UP ] + - name: unit + options: [ YEAR, MONTH, WEEK, DAY, HOUR, MINUTE, SECOND, MILLISECOND, MICROSECOND ] + - name: origin + options: [ YEAR, MONTH, MONDAY_WEEK, SUNDAY_WEEK, ISO_WEEK, + US_WEEK, DAY, HOUR, MINUTE, SECOND, MILLISECOND ] + - name: multiple + value: i64 + return: precision_timestamp

- args: - name: x value: timestamp_tz @@ -757,6 +951,22 @@ scalar_functions: description: Timezone string from IANA tzdb. value: string return: timestamp_tz + - args: + - name: x + value: precision_timestamp_tz

+ - name: rounding + options: [ FLOOR, CEIL, ROUND_TIE_DOWN, ROUND_TIE_UP ] + - name: unit + options: [ YEAR, MONTH, WEEK, DAY, HOUR, MINUTE, SECOND, MILLISECOND, MICROSECOND ] + - name: origin + options: [ YEAR, MONTH, MONDAY_WEEK, SUNDAY_WEEK, ISO_WEEK, + US_WEEK, DAY, HOUR, MINUTE, SECOND, MILLISECOND ] + - name: multiple + value: i64 + - name: timezone + description: Timezone string from IANA tzdb. + value: string + return: precision_timestamp_tz

- args: - name: x value: date @@ -811,6 +1021,13 @@ aggregate_functions: decomposable: MANY intermediate: timestamp? return: timestamp? + - args: + - name: x + value: precision_timestamp

+ nullability: DECLARED_OUTPUT + decomposable: MANY + intermediate: precision_timestamp?

+ return: precision_timestamp?

- args: - name: x value: timestamp_tz @@ -818,6 +1035,13 @@ aggregate_functions: decomposable: MANY intermediate: timestamp_tz? return: timestamp_tz? + - args: + - name: x + value: precision_timestamp_tz

+ nullability: DECLARED_OUTPUT + decomposable: MANY + intermediate: precision_timestamp_tz?

+ return: precision_timestamp_tz?

- args: - name: x value: interval_day @@ -863,6 +1087,13 @@ aggregate_functions: decomposable: MANY intermediate: timestamp_tz? return: timestamp_tz? + - args: + - name: x + value: precision_timestamp_tz

+ nullability: DECLARED_OUTPUT + decomposable: MANY + intermediate: precision_timestamp_tz?

+ return: precision_timestamp_tz?

- args: - name: x value: interval_day