diff options
author | Maxim Yurchuk <maxim-yurchuk@ydb.tech> | 2024-11-20 17:37:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-20 17:37:57 +0000 |
commit | f76323e9b295c15751e51e3443aa47a36bee8023 (patch) | |
tree | 4113c8cad473a33e0f746966e0cf087252fa1d7a /yql/essentials/tests/sql/suites/blocks/date_sub_scalar.sql | |
parent | 753ecb8d410a4cb459c26f3a0082fb2d1724fe63 (diff) | |
parent | a7b9a6afea2a9d7a7bfac4c5eb4c1a8e60adb9e6 (diff) | |
download | ydb-f76323e9b295c15751e51e3443aa47a36bee8023.tar.gz |
Merge pull request #11788 from ydb-platform/mergelibs-241120-1113
Library import 241120-1113
Diffstat (limited to 'yql/essentials/tests/sql/suites/blocks/date_sub_scalar.sql')
-rw-r--r-- | yql/essentials/tests/sql/suites/blocks/date_sub_scalar.sql | 326 |
1 files changed, 326 insertions, 0 deletions
diff --git a/yql/essentials/tests/sql/suites/blocks/date_sub_scalar.sql b/yql/essentials/tests/sql/suites/blocks/date_sub_scalar.sql new file mode 100644 index 0000000000..efe5c86006 --- /dev/null +++ b/yql/essentials/tests/sql/suites/blocks/date_sub_scalar.sql @@ -0,0 +1,326 @@ +USE plato; +pragma yt.DisableOptimizers="OutHorizontalJoin,HorizontalJoin,MultiHorizontalJoin,FuseMultiOutsWithOuterMaps"; + +SELECT + Date("2000-01-01") - na, + Date("2000-01-01") - naz, + Date("2000-01-01") - nd, + Date("2000-01-01") - ndz, + Date("2000-01-01") - nt, + Date("2000-01-01") - ntz, + Date("2000-01-01") - wa, + Date("2000-01-01") - wd, + Date("2000-01-01") - wt, + Date("2000-01-01") - waz, + Date("2000-01-01") - wdz, + Date("2000-01-01") - wtz, + + TzDate("2000-01-01,Europe/Moscow") - na, + TzDate("2000-01-01,Europe/Moscow") - naz, + TzDate("2000-01-01,Europe/Moscow") - nd, + TzDate("2000-01-01,Europe/Moscow") - ndz, + TzDate("2000-01-01,Europe/Moscow") - nt, + TzDate("2000-01-01,Europe/Moscow") - ntz, + TzDate("2000-01-01,Europe/Moscow") - wa, + TzDate("2000-01-01,Europe/Moscow") - wd, + TzDate("2000-01-01,Europe/Moscow") - wt, + TzDate("2000-01-01,Europe/Moscow") - waz, + TzDate("2000-01-01,Europe/Moscow") - wdz, + TzDate("2000-01-01,Europe/Moscow") - wtz, + + Datetime("2000-01-01T03:04:05Z") - na, + Datetime("2000-01-01T03:04:05Z") - naz, + Datetime("2000-01-01T03:04:05Z") - nd, + Datetime("2000-01-01T03:04:05Z") - ndz, + Datetime("2000-01-01T03:04:05Z") - nt, + Datetime("2000-01-01T03:04:05Z") - ntz, + Datetime("2000-01-01T03:04:05Z") - wa, + Datetime("2000-01-01T03:04:05Z") - wd, + Datetime("2000-01-01T03:04:05Z") - wt, + Datetime("2000-01-01T03:04:05Z") - waz, + Datetime("2000-01-01T03:04:05Z") - wdz, + Datetime("2000-01-01T03:04:05Z") - wtz, + + TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - na, + TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - naz, + TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - nd, + TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - ndz, + TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - nt, + TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - ntz, + TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - wa, + TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - wd, + TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - wt, + TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - waz, + TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - wdz, + TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - wtz, + + Timestamp("2000-01-01T03:04:05.678912Z") - na, + Timestamp("2000-01-01T03:04:05.678912Z") - naz, + Timestamp("2000-01-01T03:04:05.678912Z") - nd, + Timestamp("2000-01-01T03:04:05.678912Z") - ndz, + Timestamp("2000-01-01T03:04:05.678912Z") - nt, + Timestamp("2000-01-01T03:04:05.678912Z") - ntz, + Timestamp("2000-01-01T03:04:05.678912Z") - wa, + Timestamp("2000-01-01T03:04:05.678912Z") - wd, + Timestamp("2000-01-01T03:04:05.678912Z") - wt, + Timestamp("2000-01-01T03:04:05.678912Z") - waz, + Timestamp("2000-01-01T03:04:05.678912Z") - wdz, + Timestamp("2000-01-01T03:04:05.678912Z") - wtz, + + TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - na, + TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - naz, + TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - nd, + TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - ndz, + TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - nt, + TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - ntz, + TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - wa, + TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - wd, + TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - wt, + TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - waz, + TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - wdz, + TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - wtz, + +FROM Dates; + +SELECT + Date32("1900-01-01") - na, + Date32("1900-01-01") - naz, + Date32("1900-01-01") - nd, + Date32("1900-01-01") - ndz, + Date32("1900-01-01") - nt, + Date32("1900-01-01") - ntz, + Date32("1900-01-01") - wa, + Date32("1900-01-01") - wd, + Date32("1900-01-01") - wt, + Date32("1900-01-01") - waz, + Date32("1900-01-01") - wdz, + Date32("1900-01-01") - wtz, + + Datetime64("1900-01-01T03:04:05Z") - na, + Datetime64("1900-01-01T03:04:05Z") - naz, + Datetime64("1900-01-01T03:04:05Z") - nd, + Datetime64("1900-01-01T03:04:05Z") - ndz, + Datetime64("1900-01-01T03:04:05Z") - nt, + Datetime64("1900-01-01T03:04:05Z") - ntz, + Datetime64("1900-01-01T03:04:05Z") - wa, + Datetime64("1900-01-01T03:04:05Z") - wd, + Datetime64("1900-01-01T03:04:05Z") - wt, + Datetime64("1900-01-01T03:04:05Z") - waz, + Datetime64("1900-01-01T03:04:05Z") - wdz, + Datetime64("1900-01-01T03:04:05Z") - wtz, + + Timestamp64("1900-01-01T03:04:05.678912Z") - na, + Timestamp64("1900-01-01T03:04:05.678912Z") - naz, + Timestamp64("1900-01-01T03:04:05.678912Z") - nd, + Timestamp64("1900-01-01T03:04:05.678912Z") - ndz, + Timestamp64("1900-01-01T03:04:05.678912Z") - nt, + Timestamp64("1900-01-01T03:04:05.678912Z") - ntz, + Timestamp64("1900-01-01T03:04:05.678912Z") - wa, + Timestamp64("1900-01-01T03:04:05.678912Z") - wd, + Timestamp64("1900-01-01T03:04:05.678912Z") - wt, + Timestamp64("1900-01-01T03:04:05.678912Z") - waz, + Timestamp64("1900-01-01T03:04:05.678912Z") - wdz, + Timestamp64("1900-01-01T03:04:05.678912Z") - wtz, + + TzDate32("1900-01-01,Europe/Moscow") - na, + TzDate32("1900-01-01,Europe/Moscow") - naz, + TzDate32("1900-01-01,Europe/Moscow") - nd, + TzDate32("1900-01-01,Europe/Moscow") - ndz, + TzDate32("1900-01-01,Europe/Moscow") - nt, + TzDate32("1900-01-01,Europe/Moscow") - ntz, + TzDate32("1900-01-01,Europe/Moscow") - wa, + TzDate32("1900-01-01,Europe/Moscow") - wd, + TzDate32("1900-01-01,Europe/Moscow") - wt, + TzDate32("1900-01-01,Europe/Moscow") - waz, + TzDate32("1900-01-01,Europe/Moscow") - wdz, + TzDate32("1900-01-01,Europe/Moscow") - wtz, + + TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - na, + TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - naz, + TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - nd, + TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - ndz, + TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - nt, + TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - ntz, + TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - wa, + TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - wd, + TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - wt, + TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - waz, + TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - wdz, + TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - wtz, + + TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - na, + TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - naz, + TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - nd, + TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - ndz, + TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - nt, + TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - ntz, + TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - wa, + TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - wd, + TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - wt, + TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - waz, + TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - wdz, + TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - wtz + +FROM Dates; + +SELECT + na - Date("2000-01-01"), + naz - Date("2000-01-01"), + nd - Date("2000-01-01"), + ndz - Date("2000-01-01"), + nt - Date("2000-01-01"), + ntz - Date("2000-01-01"), + wa - Date("2000-01-01"), + wd - Date("2000-01-01"), + wt - Date("2000-01-01"), + waz - Date("2000-01-01"), + wdz - Date("2000-01-01"), + wtz - Date("2000-01-01"), + + na - TzDate("2000-01-01,Europe/Moscow"), + naz - TzDate("2000-01-01,Europe/Moscow"), + nd - TzDate("2000-01-01,Europe/Moscow"), + ndz - TzDate("2000-01-01,Europe/Moscow"), + nt - TzDate("2000-01-01,Europe/Moscow"), + ntz - TzDate("2000-01-01,Europe/Moscow"), + wa - TzDate("2000-01-01,Europe/Moscow"), + wd - TzDate("2000-01-01,Europe/Moscow"), + wt - TzDate("2000-01-01,Europe/Moscow"), + waz - TzDate("2000-01-01,Europe/Moscow"), + wdz - TzDate("2000-01-01,Europe/Moscow"), + wtz - TzDate("2000-01-01,Europe/Moscow"), + + na - Datetime("2000-01-01T03:04:05Z"), + naz - Datetime("2000-01-01T03:04:05Z"), + nd - Datetime("2000-01-01T03:04:05Z"), + ndz - Datetime("2000-01-01T03:04:05Z"), + nt - Datetime("2000-01-01T03:04:05Z"), + ntz - Datetime("2000-01-01T03:04:05Z"), + wa - Datetime("2000-01-01T03:04:05Z"), + wd - Datetime("2000-01-01T03:04:05Z"), + wt - Datetime("2000-01-01T03:04:05Z"), + waz - Datetime("2000-01-01T03:04:05Z"), + wdz - Datetime("2000-01-01T03:04:05Z"), + wtz - Datetime("2000-01-01T03:04:05Z"), + + na - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"), + naz - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"), + nd - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"), + ndz - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"), + nt - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"), + ntz - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"), + wa - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"), + wd - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"), + wt - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"), + waz - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"), + wdz - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"), + wtz - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"), + + na - Timestamp("2000-01-01T03:04:05.678912Z"), + naz - Timestamp("2000-01-01T03:04:05.678912Z"), + nd - Timestamp("2000-01-01T03:04:05.678912Z"), + ndz - Timestamp("2000-01-01T03:04:05.678912Z"), + nt - Timestamp("2000-01-01T03:04:05.678912Z"), + ntz - Timestamp("2000-01-01T03:04:05.678912Z"), + wa - Timestamp("2000-01-01T03:04:05.678912Z"), + wd - Timestamp("2000-01-01T03:04:05.678912Z"), + wt - Timestamp("2000-01-01T03:04:05.678912Z"), + waz - Timestamp("2000-01-01T03:04:05.678912Z"), + wdz - Timestamp("2000-01-01T03:04:05.678912Z"), + wtz - Timestamp("2000-01-01T03:04:05.678912Z"), + + na - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"), + naz - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"), + nd - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"), + ndz - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"), + nt - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"), + ntz - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"), + wa - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"), + wd - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"), + wt - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"), + waz - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"), + wdz - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"), + wtz - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"), +FROM Dates; + +SELECT + na - Date32("1900-01-01"), + naz - Date32("1900-01-01"), + nd - Date32("1900-01-01"), + ndz - Date32("1900-01-01"), + nt - Date32("1900-01-01"), + ntz - Date32("1900-01-01"), + wa - Date32("1900-01-01"), + wd - Date32("1900-01-01"), + wt - Date32("1900-01-01"), + waz - Date32("1900-01-01"), + wdz - Date32("1900-01-01"), + wtz - Date32("1900-01-01"), + + na - Datetime64("1900-01-01T03:04:05Z"), + naz - Datetime64("1900-01-01T03:04:05Z"), + nd - Datetime64("1900-01-01T03:04:05Z"), + ndz - Datetime64("1900-01-01T03:04:05Z"), + nt - Datetime64("1900-01-01T03:04:05Z"), + ntz - Datetime64("1900-01-01T03:04:05Z"), + wa - Datetime64("1900-01-01T03:04:05Z"), + wd - Datetime64("1900-01-01T03:04:05Z"), + wt - Datetime64("1900-01-01T03:04:05Z"), + waz - Datetime64("1900-01-01T03:04:05Z"), + wdz - Datetime64("1900-01-01T03:04:05Z"), + wtz - Datetime64("1900-01-01T03:04:05Z"), + + na - Timestamp64("1900-01-01T03:04:05.678912Z"), + naz - Timestamp64("1900-01-01T03:04:05.678912Z"), + nd - Timestamp64("1900-01-01T03:04:05.678912Z"), + ndz - Timestamp64("1900-01-01T03:04:05.678912Z"), + nt - Timestamp64("1900-01-01T03:04:05.678912Z"), + ntz - Timestamp64("1900-01-01T03:04:05.678912Z"), + wa - Timestamp64("1900-01-01T03:04:05.678912Z"), + wd - Timestamp64("1900-01-01T03:04:05.678912Z"), + wt - Timestamp64("1900-01-01T03:04:05.678912Z"), + waz - Timestamp64("1900-01-01T03:04:05.678912Z"), + wdz - Timestamp64("1900-01-01T03:04:05.678912Z"), + wtz - Timestamp64("1900-01-01T03:04:05.678912Z"), + + na - TzDate32("1900-01-01,Europe/Moscow"), + naz - TzDate32("1900-01-01,Europe/Moscow"), + nd - TzDate32("1900-01-01,Europe/Moscow"), + ndz - TzDate32("1900-01-01,Europe/Moscow"), + nt - TzDate32("1900-01-01,Europe/Moscow"), + ntz - TzDate32("1900-01-01,Europe/Moscow"), + wa - TzDate32("1900-01-01,Europe/Moscow"), + wd - TzDate32("1900-01-01,Europe/Moscow"), + wt - TzDate32("1900-01-01,Europe/Moscow"), + waz - TzDate32("1900-01-01,Europe/Moscow"), + wdz - TzDate32("1900-01-01,Europe/Moscow"), + wtz - TzDate32("1900-01-01,Europe/Moscow"), + + na - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"), + naz - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"), + nd - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"), + ndz - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"), + nt - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"), + ntz - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"), + wa - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"), + wd - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"), + wt - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"), + waz - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"), + wdz - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"), + wtz - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"), + + na - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"), + naz - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"), + nd - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"), + ndz - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"), + nt - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"), + ntz - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"), + wa - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"), + wd - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"), + wt - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"), + waz - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"), + wdz - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"), + wtz - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") + +FROM Dates; + |