aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/blocks/date_sub_scalar.sql
diff options
context:
space:
mode:
authorudovichenko-r <udovichenko-r@yandex-team.com>2024-11-19 14:58:38 +0300
committerudovichenko-r <udovichenko-r@yandex-team.com>2024-11-19 15:16:27 +0300
commit24521403b1c44303e043ba540c09b1fe991c7474 (patch)
tree341d1e7206bc7c143d04d2d96f05b6dc0655606d /yql/essentials/tests/sql/suites/blocks/date_sub_scalar.sql
parent72b3cd51dc3fb9d16975d353ea82fd85701393cc (diff)
downloadydb-24521403b1c44303e043ba540c09b1fe991c7474.tar.gz
YQL-19206 Move contrib/ydb/library/yql/tests/sql/suites -> yql/essentials/tests/sql/suites
commit_hash:d0ef1f92b09c94db7c2408f946d2a4c62b603f00
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.sql326
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;
+