Skip to content

Commit 70deecf

Browse files
committed
Tweak signatures for Resource<Datetime2.TM64> overloads
1 parent 5a1a8f9 commit 70deecf

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

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

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,16 @@ struct TGetTimeComponent {
385385
Y_ENSURE(!block);
386386

387387
if (resource.GetTag() == TStringRef::Of(TM64ResourceName)) {
388+
// FIXME: The condition below is required to untie the
389+
// Gordian knot with the upgrade, when two MiniKQL
390+
// runtimes with different versions are being used.
391+
// See YQL-19967 for more info.
392+
if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
393+
::TStringBuilder sb;
394+
sb << "Unexpected Resource tag: got '" << resource.GetTag() << "'";
395+
builder.SetError(sb);
396+
return true;
397+
}
388398
BuildSignature<TFieldStorage, TM64ResourceName, WAccessor>(builder, typesOnly);
389399
return true;
390400
}
@@ -1166,6 +1176,16 @@ class TGetDateComponent: public ::NYql::NUdf::TBoxedValue {
11661176
}
11671177

11681178
if (resource.GetTag() == TStringRef::Of(TM64ResourceName)) {
1179+
// FIXME: The condition below is required to untie the
1180+
// Gordian knot with the upgrade, when two MiniKQL
1181+
// runtimes with different versions are being used.
1182+
// See YQL-19967 for more info.
1183+
if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
1184+
::TStringBuilder sb;
1185+
sb << "Unexpected Resource tag: got '" << resource.GetTag() << "'";
1186+
builder.SetError(sb);
1187+
return true;
1188+
}
11691189
BuildSignature<TResultWType, TM64ResourceName, WAccessor>(builder, typesOnly);
11701190
return true;
11711191
}
@@ -1280,6 +1300,16 @@ class TGetDateComponentName: public ::NYql::NUdf::TBoxedValue {
12801300
}
12811301

12821302
if (resource.GetTag() == TStringRef::Of(TM64ResourceName)) {
1303+
// FIXME: The condition below is required to untie the
1304+
// Gordian knot with the upgrade, when two MiniKQL
1305+
// runtimes with different versions are being used.
1306+
// See YQL-19967 for more info.
1307+
if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
1308+
::TStringBuilder sb;
1309+
sb << "Unexpected Resource tag: got '" << resource.GetTag() << "'";
1310+
builder.SetError(sb);
1311+
return true;
1312+
}
12831313
BuildSignature<TM64ResourceName, WAccessor>(builder, typesOnly);
12841314
return true;
12851315
}
@@ -1515,6 +1545,16 @@ TUnboxedValue GetTimezoneName(const IValueBuilder* valueBuilder, const TUnboxedV
15151545
}
15161546

15171547
if (resource.GetTag() == TStringRef::Of(TM64ResourceName)) {
1548+
// FIXME: The condition below is required to untie the
1549+
// Gordian knot with the upgrade, when two MiniKQL
1550+
// runtimes with different versions are being used.
1551+
// See YQL-19967 for more info.
1552+
if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
1553+
::TStringBuilder sb;
1554+
sb << "Unexpected Resource tag: got '" << resource.GetTag() << "'";
1555+
builder.SetError(sb);
1556+
return true;
1557+
}
15181558
BuildSignature<TM64ResourceName>(builder, typesOnly);
15191559
return true;
15201560
}
@@ -1817,6 +1857,16 @@ class TBoundaryOf: public ::NYql::NUdf::TBoxedValue {
18171857
}
18181858

18191859
if (resource.GetTag() == TStringRef::Of(TM64ResourceName)) {
1860+
// FIXME: The condition below is required to untie the
1861+
// Gordian knot with the upgrade, when two MiniKQL
1862+
// runtimes with different versions are being used.
1863+
// See YQL-19967 for more info.
1864+
if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
1865+
::TStringBuilder sb;
1866+
sb << "Unexpected Resource tag: got '" << resource.GetTag() << "'";
1867+
builder.SetError(sb);
1868+
return true;
1869+
}
18201870
BuildSignature<TM64ResourceName, WBoundary>(builder, typesOnly);
18211871
return true;
18221872
}
@@ -2198,6 +2248,16 @@ class TShift : public TBoxedValue {
21982248
}
21992249

22002250
if (resource.GetTag() == TStringRef::Of(TM64ResourceName)) {
2251+
// FIXME: The condition below is required to untie the
2252+
// Gordian knot with the upgrade, when two MiniKQL
2253+
// runtimes with different versions are being used.
2254+
// See YQL-19967 for more info.
2255+
if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
2256+
::TStringBuilder sb;
2257+
sb << "Unexpected Resource tag: got '" << resource.GetTag() << "'";
2258+
builder.SetError(sb);
2259+
return true;
2260+
}
22012261
BuildSignature<TM64ResourceName, WShifter>(builder, typesOnly);
22022262
return true;
22032263
}

0 commit comments

Comments
 (0)