Skip to content

Commit 1a82965

Browse files
committed
YQL-19700: Make DateTime UDF overloads backward compatible
Follows up e9d589d43101dde8ca86955627fca9dbdaba1f7b Follows up ed323f55ce6ca64b9a912772866d7bfb4fc1235f Follows up 3b203e7a313e54ee57069763da5cf1b59991d66c Follows up 99b69544bd45b52e2e6bfcd8cd51e34827a0f08d Follows up 3afbcdd00ad47ecf35cb29bb25a5d7658ed1d5cb Follows up ca9883df39a8c08e7f0d83bafcbb8853f243ed04 Follows up cfaa3532a6554646b11f204e6f4cc7677d428b8b Follows up 9dcc43f4facdab5b4fca0a4079833c8534359124 commit_hash:7b8d84f03c1c623e6d076da42c5f0c3437f7acf6 (cherry picked from commit 519ccaf)
1 parent 1ffb60c commit 1a82965

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

yql/essentials/udfs/common/datetime2/datetime_udf.cpp

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,7 +1983,13 @@ class TToConverter : public TBoxedValue {
19831983
}
19841984

19851985
if (!userType) {
1986-
builder.SetError("User type is missing");
1986+
// XXX: Function became polymorphic when overload for
1987+
// wide resources was implemented. Hence, to make it
1988+
// backward compatible with previous versions, the
1989+
// absence of the userType is considered as using the
1990+
// old version (i.e. without type awareness) that
1991+
// provides implementation only for narrow dates.
1992+
BuildSignature<TInterval, TResult>(builder, typesOnly);
19871993
return true;
19881994
}
19891995

@@ -2451,7 +2457,13 @@ class TBoundaryOfInterval: public ::NYql::NUdf::TBoxedValue {
24512457
}
24522458

24532459
if (!userType) {
2454-
builder.SetError("User type is missing");
2460+
// XXX: Function became polymorphic when overload for
2461+
// wide resources was implemented. Hence, to make it
2462+
// backward compatible with previous versions, the
2463+
// absence of the userType is considered as using the
2464+
// old version (i.e. without type awareness) that
2465+
// provides implementation only for narrow dates.
2466+
BuildSignature<TMResourceName, Boundary>(builder, typesOnly);
24552467
return true;
24562468
}
24572469

@@ -2567,7 +2579,13 @@ class TTimeOfDay: public ::NYql::NUdf::TBoxedValue {
25672579
}
25682580

25692581
if (!userType) {
2570-
builder.SetError("User type is missing");
2582+
// XXX: Function became polymorphic when overload for
2583+
// wide resources was implemented. Hence, to make it
2584+
// backward compatible with previous versions, the
2585+
// absence of the userType is considered as using the
2586+
// old version (i.e. without type awareness) that
2587+
// provides implementation only for narrow dates.
2588+
BuildSignature<TMResourceName>(builder, typesOnly);
25712589
return true;
25722590
}
25732591

0 commit comments

Comments
 (0)