aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimunkin <imunkin@yandex-team.com>2024-11-27 17:22:52 +0300
committerimunkin <imunkin@yandex-team.com>2024-11-27 17:44:32 +0300
commit33266313a237df5574c6426ea4beb6c165b9f3d7 (patch)
tree25125a0b8673417e29d073d4f35272655e23bee2
parent2d4ccf80e7eefd304f113a94a6d1a1b2e9eb5d4c (diff)
downloadydb-33266313a237df5574c6426ea4beb6c165b9f3d7.tar.gz
YQL-18303: Introduce IntervalFrom* converters overloads for Interval64
commit_hash:c17121050d6f0624a1d96d89bac0326fb899315c
-rw-r--r--yql/essentials/udfs/common/datetime2/datetime_udf.cpp72
-rw-r--r--yql/essentials/udfs/common/datetime2/test/canondata/test.test_BlockFrom_/results.txt8
-rw-r--r--yql/essentials/udfs/common/datetime2/test_bigdates/canondata/test.test_BlockFrom_/results.txt144
-rw-r--r--yql/essentials/udfs/common/datetime2/test_bigdates/canondata/test.test_From_/results.txt144
-rw-r--r--yql/essentials/udfs/common/datetime2/test_bigdates/cases/BlockFrom.in78
-rw-r--r--yql/essentials/udfs/common/datetime2/test_bigdates/cases/BlockFrom.in.attr42
-rw-r--r--yql/essentials/udfs/common/datetime2/test_bigdates/cases/BlockFrom.sql7
-rw-r--r--yql/essentials/udfs/common/datetime2/test_bigdates/cases/From.in78
-rw-r--r--yql/essentials/udfs/common/datetime2/test_bigdates/cases/From.in.attr42
-rw-r--r--yql/essentials/udfs/common/datetime2/test_bigdates/cases/From.sql7
10 files changed, 534 insertions, 88 deletions
diff --git a/yql/essentials/udfs/common/datetime2/datetime_udf.cpp b/yql/essentials/udfs/common/datetime2/datetime_udf.cpp
index 3798557b91..d7948c3371 100644
--- a/yql/essentials/udfs/common/datetime2/datetime_udf.cpp
+++ b/yql/essentials/udfs/common/datetime2/datetime_udf.cpp
@@ -561,10 +561,16 @@ TValue DoAddYears(const TValue& date, i64 years, const NUdf::IDateBuilder& build
return timestamp >= MIN_TIMESTAMP64 && timestamp <= MAX_TIMESTAMP64;
}
- inline bool ValidateInterval(i64 interval) {
+ template<>
+ inline bool Validate<TInterval>(i64 interval) {
return interval > -i64(MAX_TIMESTAMP) && interval < i64(MAX_TIMESTAMP);
}
+ template<>
+ inline bool Validate<TInterval64>(i64 interval) {
+ return interval >= -MAX_INTERVAL64 && interval <= MAX_INTERVAL64;
+ }
+
// Split
template<typename TUserDataType, bool Nullable>
@@ -1306,52 +1312,19 @@ TValue DoAddYears(const TValue& date, i64 years, const NUdf::IDateBuilder& build
DATETIME_FROM_CONVERTER_UDF(FromMilliseconds64, TTimestamp64, i64, UsecondsInMilliseconds);
DATETIME_FROM_CONVERTER_UDF(FromMicroseconds64, TTimestamp64, i64, 1);
+ DATETIME_FROM_CONVERTER_UDF(IntervalFromDays, TInterval, i32, UsecondsInDay);
+ DATETIME_FROM_CONVERTER_UDF(IntervalFromHours, TInterval, i32, UsecondsInHour);
+ DATETIME_FROM_CONVERTER_UDF(IntervalFromMinutes, TInterval, i32, UsecondsInMinute);
+ DATETIME_FROM_CONVERTER_UDF(IntervalFromSeconds, TInterval, i32, UsecondsInSecond);
+ DATETIME_FROM_CONVERTER_UDF(IntervalFromMilliseconds, TInterval, i64, UsecondsInMilliseconds);
+ DATETIME_FROM_CONVERTER_UDF(IntervalFromMicroseconds, TInterval, i64, 1);
- template <typename TInput, i64 Multiplier>
- using TIntervalFromKernel = TUnaryUnsafeFixedSizeFilterKernel<TInput, i64,
- [] (TInput interval) { return std::make_pair(i64(interval * Multiplier), ValidateInterval(interval)); }>;
-
- BEGIN_SIMPLE_STRICT_ARROW_UDF(TIntervalFromDays, TOptional<TInterval>(TAutoMap<i32>)) {
- Y_UNUSED(valueBuilder);
- const i64 res = i64(args[0].Get<i32>()) * UsecondsInDay;
- return ValidateInterval(res) ? TUnboxedValuePod(res) : TUnboxedValuePod();
- }
- END_SIMPLE_ARROW_UDF(TIntervalFromDays, (TIntervalFromKernel<i32, UsecondsInDay>::Do));
-
- BEGIN_SIMPLE_STRICT_ARROW_UDF(TIntervalFromHours, TOptional<TInterval>(TAutoMap<i32>)) {
- Y_UNUSED(valueBuilder);
- const i64 res = i64(args[0].Get<i32>()) * UsecondsInHour;
- return ValidateInterval(res) ? TUnboxedValuePod(res) : TUnboxedValuePod();
- }
- END_SIMPLE_ARROW_UDF(TIntervalFromHours, (TIntervalFromKernel<i32, UsecondsInHour>::Do));
-
- BEGIN_SIMPLE_STRICT_ARROW_UDF(TIntervalFromMinutes, TOptional<TInterval>(TAutoMap<i32>)) {
- Y_UNUSED(valueBuilder);
- const i64 res = i64(args[0].Get<i32>()) * UsecondsInMinute;
- return ValidateInterval(res) ? TUnboxedValuePod(res) : TUnboxedValuePod();
- }
- END_SIMPLE_ARROW_UDF(TIntervalFromMinutes, (TIntervalFromKernel<i32, UsecondsInMinute>::Do));
-
- BEGIN_SIMPLE_STRICT_ARROW_UDF(TIntervalFromSeconds, TOptional<TInterval>(TAutoMap<i32>)) {
- Y_UNUSED(valueBuilder);
- const i64 res = i64(args[0].Get<i32>()) * UsecondsInSecond;
- return ValidateInterval(res) ? TUnboxedValuePod(res) : TUnboxedValuePod();
- }
- END_SIMPLE_ARROW_UDF(TIntervalFromSeconds, (TIntervalFromKernel<i32, UsecondsInSecond>::Do));
-
- BEGIN_SIMPLE_STRICT_ARROW_UDF(TIntervalFromMilliseconds, TOptional<TInterval>(TAutoMap<i64>)) {
- Y_UNUSED(valueBuilder);
- const i64 res = i64(args[0].Get<i64>()) * UsecondsInMilliseconds;
- return ValidateInterval(res) ? TUnboxedValuePod(res) : TUnboxedValuePod();
- }
- END_SIMPLE_ARROW_UDF(TIntervalFromMilliseconds, (TIntervalFromKernel<i64, UsecondsInMilliseconds>::Do));
-
- BEGIN_SIMPLE_STRICT_ARROW_UDF(TIntervalFromMicroseconds, TOptional<TInterval>(TAutoMap<i64>)) {
- Y_UNUSED(valueBuilder);
- const i64 res = args[0].Get<i64>();
- return ValidateInterval(res) ? TUnboxedValuePod(res) : TUnboxedValuePod();
- }
- END_SIMPLE_ARROW_UDF(TIntervalFromMicroseconds, (TIntervalFromKernel<i64, 1>::Do));
+ DATETIME_FROM_CONVERTER_UDF(Interval64FromDays, TInterval64, i32, UsecondsInDay);
+ DATETIME_FROM_CONVERTER_UDF(Interval64FromHours, TInterval64, i64, UsecondsInHour);
+ DATETIME_FROM_CONVERTER_UDF(Interval64FromMinutes, TInterval64, i64, UsecondsInMinute);
+ DATETIME_FROM_CONVERTER_UDF(Interval64FromSeconds, TInterval64, i64, UsecondsInSecond);
+ DATETIME_FROM_CONVERTER_UDF(Interval64FromMilliseconds, TInterval64, i64, UsecondsInMilliseconds);
+ DATETIME_FROM_CONVERTER_UDF(Interval64FromMicroseconds, TInterval64, i64, 1);
// To*
@@ -2437,6 +2410,13 @@ TValue DoAddYears(const TValue& date, i64 years, const NUdf::IDateBuilder& build
TIntervalFromMilliseconds,
TIntervalFromMicroseconds,
+ TInterval64FromDays,
+ TInterval64FromHours,
+ TInterval64FromMinutes,
+ TInterval64FromSeconds,
+ TInterval64FromMilliseconds,
+ TInterval64FromMicroseconds,
+
TToDays,
TToHours,
TToMinutes,
diff --git a/yql/essentials/udfs/common/datetime2/test/canondata/test.test_BlockFrom_/results.txt b/yql/essentials/udfs/common/datetime2/test/canondata/test.test_BlockFrom_/results.txt
index b053c8139f..64185a531a 100644
--- a/yql/essentials/udfs/common/datetime2/test/canondata/test.test_BlockFrom_/results.txt
+++ b/yql/essentials/udfs/common/datetime2/test/canondata/test.test_BlockFrom_/results.txt
@@ -160,9 +160,7 @@
[
"-604800000000"
];
- [
- "8640000000000000"
- ];
+ #;
#
];
[
@@ -194,9 +192,7 @@
[
"-604800000000"
];
- [
- "8640000000000000"
- ];
+ #;
#
]
]
diff --git a/yql/essentials/udfs/common/datetime2/test_bigdates/canondata/test.test_BlockFrom_/results.txt b/yql/essentials/udfs/common/datetime2/test_bigdates/canondata/test.test_BlockFrom_/results.txt
index 2e8e14b3b2..6cafc251d1 100644
--- a/yql/essentials/udfs/common/datetime2/test_bigdates/canondata/test.test_BlockFrom_/results.txt
+++ b/yql/essentials/udfs/common/datetime2/test_bigdates/canondata/test.test_BlockFrom_/results.txt
@@ -36,6 +36,66 @@
"Timestamp64"
]
]
+ ];
+ [
+ "interval64_days";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Interval64"
+ ]
+ ]
+ ];
+ [
+ "interval64_hours";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Interval64"
+ ]
+ ]
+ ];
+ [
+ "interval64_minutes";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Interval64"
+ ]
+ ]
+ ];
+ [
+ "interval64_seconds";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Interval64"
+ ]
+ ]
+ ];
+ [
+ "interval64_msec";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Interval64"
+ ]
+ ]
+ ];
+ [
+ "interval64_usec";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Interval64"
+ ]
+ ]
]
]
]
@@ -50,6 +110,24 @@
];
[
"3875345000000"
+ ];
+ [
+ "604800000000"
+ ];
+ [
+ "604800000000"
+ ];
+ [
+ "604800000000"
+ ];
+ [
+ "604800000000"
+ ];
+ [
+ "604800000000"
+ ];
+ [
+ "604800000000"
]
];
[
@@ -61,6 +139,24 @@
];
[
"4291747200000000"
+ ];
+ [
+ "4291747200000000"
+ ];
+ [
+ "4291747200000000"
+ ];
+ [
+ "4291747200000000"
+ ];
+ [
+ "4291747200000000"
+ ];
+ [
+ "4291747200000000"
+ ];
+ [
+ "4291747200000000"
]
];
[
@@ -72,11 +168,35 @@
];
[
"-4611669897600000000"
+ ];
+ [
+ "-9223339622400000000"
+ ];
+ [
+ "-9223339622400000000"
+ ];
+ [
+ "-9223339622400000000"
+ ];
+ [
+ "-9223339708799000000"
+ ];
+ [
+ "-9223339708799999000"
+ ];
+ [
+ "-9223339708799999999"
]
];
[
#;
#;
+ #;
+ #;
+ #;
+ #;
+ #;
+ #;
#
];
[
@@ -88,11 +208,35 @@
];
[
"4611669811199999999"
+ ];
+ [
+ "9223339622400000000"
+ ];
+ [
+ "9223339622400000000"
+ ];
+ [
+ "9223339622400000000"
+ ];
+ [
+ "9223339708799000000"
+ ];
+ [
+ "9223339708799999000"
+ ];
+ [
+ "9223339708799999999"
]
];
[
#;
#;
+ #;
+ #;
+ #;
+ #;
+ #;
+ #;
#
]
]
diff --git a/yql/essentials/udfs/common/datetime2/test_bigdates/canondata/test.test_From_/results.txt b/yql/essentials/udfs/common/datetime2/test_bigdates/canondata/test.test_From_/results.txt
index 2e8e14b3b2..6cafc251d1 100644
--- a/yql/essentials/udfs/common/datetime2/test_bigdates/canondata/test.test_From_/results.txt
+++ b/yql/essentials/udfs/common/datetime2/test_bigdates/canondata/test.test_From_/results.txt
@@ -36,6 +36,66 @@
"Timestamp64"
]
]
+ ];
+ [
+ "interval64_days";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Interval64"
+ ]
+ ]
+ ];
+ [
+ "interval64_hours";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Interval64"
+ ]
+ ]
+ ];
+ [
+ "interval64_minutes";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Interval64"
+ ]
+ ]
+ ];
+ [
+ "interval64_seconds";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Interval64"
+ ]
+ ]
+ ];
+ [
+ "interval64_msec";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Interval64"
+ ]
+ ]
+ ];
+ [
+ "interval64_usec";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Interval64"
+ ]
+ ]
]
]
]
@@ -50,6 +110,24 @@
];
[
"3875345000000"
+ ];
+ [
+ "604800000000"
+ ];
+ [
+ "604800000000"
+ ];
+ [
+ "604800000000"
+ ];
+ [
+ "604800000000"
+ ];
+ [
+ "604800000000"
+ ];
+ [
+ "604800000000"
]
];
[
@@ -61,6 +139,24 @@
];
[
"4291747200000000"
+ ];
+ [
+ "4291747200000000"
+ ];
+ [
+ "4291747200000000"
+ ];
+ [
+ "4291747200000000"
+ ];
+ [
+ "4291747200000000"
+ ];
+ [
+ "4291747200000000"
+ ];
+ [
+ "4291747200000000"
]
];
[
@@ -72,11 +168,35 @@
];
[
"-4611669897600000000"
+ ];
+ [
+ "-9223339622400000000"
+ ];
+ [
+ "-9223339622400000000"
+ ];
+ [
+ "-9223339622400000000"
+ ];
+ [
+ "-9223339708799000000"
+ ];
+ [
+ "-9223339708799999000"
+ ];
+ [
+ "-9223339708799999999"
]
];
[
#;
#;
+ #;
+ #;
+ #;
+ #;
+ #;
+ #;
#
];
[
@@ -88,11 +208,35 @@
];
[
"4611669811199999999"
+ ];
+ [
+ "9223339622400000000"
+ ];
+ [
+ "9223339622400000000"
+ ];
+ [
+ "9223339622400000000"
+ ];
+ [
+ "9223339708799000000"
+ ];
+ [
+ "9223339708799999000"
+ ];
+ [
+ "9223339708799999999"
]
];
[
#;
#;
+ #;
+ #;
+ #;
+ #;
+ #;
+ #;
#
]
]
diff --git a/yql/essentials/udfs/common/datetime2/test_bigdates/cases/BlockFrom.in b/yql/essentials/udfs/common/datetime2/test_bigdates/cases/BlockFrom.in
index 66cc696756..9b8575e120 100644
--- a/yql/essentials/udfs/common/datetime2/test_bigdates/cases/BlockFrom.in
+++ b/yql/essentials/udfs/common/datetime2/test_bigdates/cases/BlockFrom.in
@@ -1,30 +1,72 @@
{
- "fts64_sec" = 3875345;
- "fts64_msec" = 3875345000;
- "fts64_usec" = 3875345000000;
+ "fts64_sec" = 3875345;
+ "fts64_msec" = 3875345000;
+ "fts64_usec" = 3875345000000;
+
+ "fi64_days" = 7;
+ "fi64_hours" = 168;
+ "fi64_minutes" = 10080;
+ "fi64_seconds" = 604800;
+ "fi64_msec" = 604800000;
+ "fi64_usec" = 604800000000;
};
{
- "fts64_sec" = 4291747200;
- "fts64_msec" = 4291747200000;
- "fts64_usec" = 4291747200000000;
+ "fts64_sec" = 4291747200;
+ "fts64_msec" = 4291747200000;
+ "fts64_usec" = 4291747200000000;
+
+ "fi64_days" = 49673;
+ "fi64_hours" = 1192152;
+ "fi64_minutes" = 71529120;
+ "fi64_seconds" = 4291747200;
+ "fi64_msec" = 4291747200000;
+ "fi64_usec" = 4291747200000000;
};
{
- "fts64_sec" = -4611669897600;
- "fts64_msec" = -4611669897600000;
- "fts64_usec" = -4611669897600000000;
+ "fts64_sec" = -4611669897600;
+ "fts64_msec" = -4611669897600000;
+ "fts64_usec" = -4611669897600000000;
+
+ "fi64_days" = -106751616;
+ "fi64_hours" = -2562038784;
+ "fi64_minutes" = -153722327040;
+ "fi64_seconds" = -9223339708799;
+ "fi64_msec" = -9223339708799999;
+ "fi64_usec" = -9223339708799999999;
};
{
- "fts64_sec" = -4611669897601;
- "fts64_msec" = -4611669897600001;
- "fts64_usec" = -4611669897600000001;
+ "fts64_sec" = -4611669897601;
+ "fts64_msec" = -4611669897600001;
+ "fts64_usec" = -4611669897600000001;
+
+ "fi64_days" = -106751617;
+ "fi64_hours" = -2562038808;
+ "fi64_minutes" = -153722328480;
+ "fi64_seconds" = -9223339708800;
+ "fi64_msec" = -9223339708800000;
+ "fi64_usec" = -9223339708800000000;
};
{
- "fts64_sec" = 4611669811199;
- "fts64_msec" = 4611669811199999;
- "fts64_usec" = 4611669811199999999;
+ "fts64_sec" = 4611669811199;
+ "fts64_msec" = 4611669811199999;
+ "fts64_usec" = 4611669811199999999;
+
+ "fi64_days" = 106751616;
+ "fi64_hours" = 2562038784;
+ "fi64_minutes" = 153722327040;
+ "fi64_seconds" = 9223339708799;
+ "fi64_msec" = 9223339708799999;
+ "fi64_usec" = 9223339708799999999;
};
{
- "fts64_sec" = 4611669811200;
- "fts64_msec" = 4611669811200000;
- "fts64_usec" = 4611669811200000000;
+ "fts64_sec" = 4611669811200;
+ "fts64_msec" = 4611669811200000;
+ "fts64_usec" = 4611669811200000000;
+
+ "fi64_days" = 106751617;
+ "fi64_hours" = 2562038808;
+ "fi64_minutes" = 153722328480;
+ "fi64_seconds" = 9223339708800;
+ "fi64_msec" = 9223339708800000;
+ "fi64_usec" = 9223339708800000000;
};
diff --git a/yql/essentials/udfs/common/datetime2/test_bigdates/cases/BlockFrom.in.attr b/yql/essentials/udfs/common/datetime2/test_bigdates/cases/BlockFrom.in.attr
index ae712ef6cb..fd67725a7f 100644
--- a/yql/essentials/udfs/common/datetime2/test_bigdates/cases/BlockFrom.in.attr
+++ b/yql/essentials/udfs/common/datetime2/test_bigdates/cases/BlockFrom.in.attr
@@ -24,6 +24,48 @@
"Int64"
]
];
+ [
+ "fi64_days";
+ [
+ "DataType";
+ "Int32"
+ ]
+ ];
+ [
+ "fi64_hours";
+ [
+ "DataType";
+ "Int64"
+ ]
+ ];
+ [
+ "fi64_minutes";
+ [
+ "DataType";
+ "Int64"
+ ]
+ ];
+ [
+ "fi64_seconds";
+ [
+ "DataType";
+ "Int64"
+ ]
+ ];
+ [
+ "fi64_msec";
+ [
+ "DataType";
+ "Int64"
+ ]
+ ];
+ [
+ "fi64_usec";
+ [
+ "DataType";
+ "Int64"
+ ]
+ ];
]
]
}
diff --git a/yql/essentials/udfs/common/datetime2/test_bigdates/cases/BlockFrom.sql b/yql/essentials/udfs/common/datetime2/test_bigdates/cases/BlockFrom.sql
index 052a6da8ab..84cff261d2 100644
--- a/yql/essentials/udfs/common/datetime2/test_bigdates/cases/BlockFrom.sql
+++ b/yql/essentials/udfs/common/datetime2/test_bigdates/cases/BlockFrom.sql
@@ -5,4 +5,11 @@ select
DateTime::FromSeconds64(fts64_sec) as ts64_sec,
DateTime::FromMilliseconds64(fts64_msec) as ts64_msec,
DateTime::FromMicroseconds64(fts64_usec) as ts64_usec,
+
+ DateTime::Interval64FromDays(fi64_days) as interval64_days,
+ DateTime::Interval64FromHours(fi64_hours) as interval64_hours,
+ DateTime::Interval64FromMinutes(fi64_minutes) as interval64_minutes,
+ DateTime::Interval64FromSeconds(fi64_seconds) as interval64_seconds,
+ DateTime::Interval64FromMilliseconds(fi64_msec) as interval64_msec,
+ DateTime::Interval64FromMicroseconds(fi64_usec) as interval64_usec
from Input
diff --git a/yql/essentials/udfs/common/datetime2/test_bigdates/cases/From.in b/yql/essentials/udfs/common/datetime2/test_bigdates/cases/From.in
index 66cc696756..9b8575e120 100644
--- a/yql/essentials/udfs/common/datetime2/test_bigdates/cases/From.in
+++ b/yql/essentials/udfs/common/datetime2/test_bigdates/cases/From.in
@@ -1,30 +1,72 @@
{
- "fts64_sec" = 3875345;
- "fts64_msec" = 3875345000;
- "fts64_usec" = 3875345000000;
+ "fts64_sec" = 3875345;
+ "fts64_msec" = 3875345000;
+ "fts64_usec" = 3875345000000;
+
+ "fi64_days" = 7;
+ "fi64_hours" = 168;
+ "fi64_minutes" = 10080;
+ "fi64_seconds" = 604800;
+ "fi64_msec" = 604800000;
+ "fi64_usec" = 604800000000;
};
{
- "fts64_sec" = 4291747200;
- "fts64_msec" = 4291747200000;
- "fts64_usec" = 4291747200000000;
+ "fts64_sec" = 4291747200;
+ "fts64_msec" = 4291747200000;
+ "fts64_usec" = 4291747200000000;
+
+ "fi64_days" = 49673;
+ "fi64_hours" = 1192152;
+ "fi64_minutes" = 71529120;
+ "fi64_seconds" = 4291747200;
+ "fi64_msec" = 4291747200000;
+ "fi64_usec" = 4291747200000000;
};
{
- "fts64_sec" = -4611669897600;
- "fts64_msec" = -4611669897600000;
- "fts64_usec" = -4611669897600000000;
+ "fts64_sec" = -4611669897600;
+ "fts64_msec" = -4611669897600000;
+ "fts64_usec" = -4611669897600000000;
+
+ "fi64_days" = -106751616;
+ "fi64_hours" = -2562038784;
+ "fi64_minutes" = -153722327040;
+ "fi64_seconds" = -9223339708799;
+ "fi64_msec" = -9223339708799999;
+ "fi64_usec" = -9223339708799999999;
};
{
- "fts64_sec" = -4611669897601;
- "fts64_msec" = -4611669897600001;
- "fts64_usec" = -4611669897600000001;
+ "fts64_sec" = -4611669897601;
+ "fts64_msec" = -4611669897600001;
+ "fts64_usec" = -4611669897600000001;
+
+ "fi64_days" = -106751617;
+ "fi64_hours" = -2562038808;
+ "fi64_minutes" = -153722328480;
+ "fi64_seconds" = -9223339708800;
+ "fi64_msec" = -9223339708800000;
+ "fi64_usec" = -9223339708800000000;
};
{
- "fts64_sec" = 4611669811199;
- "fts64_msec" = 4611669811199999;
- "fts64_usec" = 4611669811199999999;
+ "fts64_sec" = 4611669811199;
+ "fts64_msec" = 4611669811199999;
+ "fts64_usec" = 4611669811199999999;
+
+ "fi64_days" = 106751616;
+ "fi64_hours" = 2562038784;
+ "fi64_minutes" = 153722327040;
+ "fi64_seconds" = 9223339708799;
+ "fi64_msec" = 9223339708799999;
+ "fi64_usec" = 9223339708799999999;
};
{
- "fts64_sec" = 4611669811200;
- "fts64_msec" = 4611669811200000;
- "fts64_usec" = 4611669811200000000;
+ "fts64_sec" = 4611669811200;
+ "fts64_msec" = 4611669811200000;
+ "fts64_usec" = 4611669811200000000;
+
+ "fi64_days" = 106751617;
+ "fi64_hours" = 2562038808;
+ "fi64_minutes" = 153722328480;
+ "fi64_seconds" = 9223339708800;
+ "fi64_msec" = 9223339708800000;
+ "fi64_usec" = 9223339708800000000;
};
diff --git a/yql/essentials/udfs/common/datetime2/test_bigdates/cases/From.in.attr b/yql/essentials/udfs/common/datetime2/test_bigdates/cases/From.in.attr
index 2e2c2d1067..afe0b1f384 100644
--- a/yql/essentials/udfs/common/datetime2/test_bigdates/cases/From.in.attr
+++ b/yql/essentials/udfs/common/datetime2/test_bigdates/cases/From.in.attr
@@ -24,6 +24,48 @@
"Int64"
]
];
+ [
+ "fi64_days";
+ [
+ "DataType";
+ "Int32"
+ ]
+ ];
+ [
+ "fi64_hours";
+ [
+ "DataType";
+ "Int64"
+ ]
+ ];
+ [
+ "fi64_minutes";
+ [
+ "DataType";
+ "Int64"
+ ]
+ ];
+ [
+ "fi64_seconds";
+ [
+ "DataType";
+ "Int64"
+ ]
+ ];
+ [
+ "fi64_msec";
+ [
+ "DataType";
+ "Int64"
+ ]
+ ];
+ [
+ "fi64_usec";
+ [
+ "DataType";
+ "Int64"
+ ]
+ ];
]
]
}
diff --git a/yql/essentials/udfs/common/datetime2/test_bigdates/cases/From.sql b/yql/essentials/udfs/common/datetime2/test_bigdates/cases/From.sql
index f1b89fc028..10de493fae 100644
--- a/yql/essentials/udfs/common/datetime2/test_bigdates/cases/From.sql
+++ b/yql/essentials/udfs/common/datetime2/test_bigdates/cases/From.sql
@@ -3,4 +3,11 @@ select
DateTime::FromSeconds64(fts64_sec) as ts64_sec,
DateTime::FromMilliseconds64(fts64_msec) as ts64_msec,
DateTime::FromMicroseconds64(fts64_usec) as ts64_usec,
+
+ DateTime::Interval64FromDays(fi64_days) as interval64_days,
+ DateTime::Interval64FromHours(fi64_hours) as interval64_hours,
+ DateTime::Interval64FromMinutes(fi64_minutes) as interval64_minutes,
+ DateTime::Interval64FromSeconds(fi64_seconds) as interval64_seconds,
+ DateTime::Interval64FromMilliseconds(fi64_msec) as interval64_msec,
+ DateTime::Interval64FromMicroseconds(fi64_usec) as interval64_usec
from Input