4
4
#include < yql/essentials/minikql/datetime/datetime.h>
5
5
#include < yql/essentials/minikql/datetime/datetime64.h>
6
6
7
+ #include < yql/essentials/minikql/mkql_runtime_version.h>
8
+
7
9
#include < yql/essentials/public/udf/arrow/udf_arrow_helpers.h>
8
10
9
11
#include < util/datetime/base.h>
@@ -314,6 +316,18 @@ struct TGetTimeComponent {
314
316
315
317
const auto features = NUdf::GetDataTypeInfo (NUdf::GetDataSlot (data.GetTypeId ())).Features ;
316
318
if (features & NUdf::BigDateType) {
319
+ // FIXME: The condition below is required to untie the
320
+ // Gordian knot with the upgrade, when two MiniKQL
321
+ // runtimes with different versions are being used.
322
+ // See YQL-19967 for more info.
323
+ if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
324
+ ::TStringBuilder sb;
325
+ sb << " Invalid argument type: got " ;
326
+ TTypePrinter (*typeInfoHelper, argType).Out (sb.Out );
327
+ sb << " , but Resource<" << TMResourceName << " > expected" ;
328
+ builder.SetError (sb);
329
+ return true ;
330
+ }
317
331
BuildSignature<TFieldStorage, TM64ResourceName, WAccessor>(builder, typesOnly);
318
332
return true ;
319
333
}
@@ -383,6 +397,16 @@ struct TGetTimeComponent {
383
397
Y_ENSURE (!block);
384
398
385
399
if (resource.GetTag () == TStringRef::Of (TM64ResourceName)) {
400
+ // FIXME: The condition below is required to untie the
401
+ // Gordian knot with the upgrade, when two MiniKQL
402
+ // runtimes with different versions are being used.
403
+ // See YQL-19967 for more info.
404
+ if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
405
+ ::TStringBuilder sb;
406
+ sb << " Unexpected Resource tag: got '" << resource.GetTag () << " '" ;
407
+ builder.SetError (sb);
408
+ return true ;
409
+ }
386
410
BuildSignature<TFieldStorage, TM64ResourceName, WAccessor>(builder, typesOnly);
387
411
return true ;
388
412
}
@@ -1146,6 +1170,18 @@ class TGetDateComponent: public ::NYql::NUdf::TBoxedValue {
1146
1170
1147
1171
const auto features = NUdf::GetDataTypeInfo (NUdf::GetDataSlot (data.GetTypeId ())).Features ;
1148
1172
if (features & NUdf::BigDateType) {
1173
+ // FIXME: The condition below is required to untie the
1174
+ // Gordian knot with the upgrade, when two MiniKQL
1175
+ // runtimes with different versions are being used.
1176
+ // See YQL-19967 for more info.
1177
+ if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
1178
+ ::TStringBuilder sb;
1179
+ sb << " Invalid argument type: got " ;
1180
+ TTypePrinter (*typeInfoHelper, argType).Out (sb.Out );
1181
+ sb << " , but Resource<" << TMResourceName << " > expected" ;
1182
+ builder.SetError (sb);
1183
+ return true ;
1184
+ }
1149
1185
BuildSignature<TResultWType, TM64ResourceName, WAccessor>(builder, typesOnly);
1150
1186
return true ;
1151
1187
}
@@ -1164,6 +1200,16 @@ class TGetDateComponent: public ::NYql::NUdf::TBoxedValue {
1164
1200
}
1165
1201
1166
1202
if (resource.GetTag () == TStringRef::Of (TM64ResourceName)) {
1203
+ // FIXME: The condition below is required to untie the
1204
+ // Gordian knot with the upgrade, when two MiniKQL
1205
+ // runtimes with different versions are being used.
1206
+ // See YQL-19967 for more info.
1207
+ if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
1208
+ ::TStringBuilder sb;
1209
+ sb << " Unexpected Resource tag: got '" << resource.GetTag () << " '" ;
1210
+ builder.SetError (sb);
1211
+ return true ;
1212
+ }
1167
1213
BuildSignature<TResultWType, TM64ResourceName, WAccessor>(builder, typesOnly);
1168
1214
return true ;
1169
1215
}
@@ -1260,6 +1306,18 @@ class TGetDateComponentName: public ::NYql::NUdf::TBoxedValue {
1260
1306
1261
1307
const auto features = NUdf::GetDataTypeInfo (NUdf::GetDataSlot (data.GetTypeId ())).Features ;
1262
1308
if (features & NUdf::BigDateType) {
1309
+ // FIXME: The condition below is required to untie the
1310
+ // Gordian knot with the upgrade, when two MiniKQL
1311
+ // runtimes with different versions are being used.
1312
+ // See YQL-19967 for more info.
1313
+ if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
1314
+ ::TStringBuilder sb;
1315
+ sb << " Invalid argument type: got " ;
1316
+ TTypePrinter (*typeInfoHelper, argType).Out (sb.Out );
1317
+ sb << " , but Resource<" << TMResourceName << " > expected" ;
1318
+ builder.SetError (sb);
1319
+ return true ;
1320
+ }
1263
1321
BuildSignature<TM64ResourceName, WAccessor>(builder, typesOnly);
1264
1322
return true ;
1265
1323
}
@@ -1278,6 +1336,16 @@ class TGetDateComponentName: public ::NYql::NUdf::TBoxedValue {
1278
1336
}
1279
1337
1280
1338
if (resource.GetTag () == TStringRef::Of (TM64ResourceName)) {
1339
+ // FIXME: The condition below is required to untie the
1340
+ // Gordian knot with the upgrade, when two MiniKQL
1341
+ // runtimes with different versions are being used.
1342
+ // See YQL-19967 for more info.
1343
+ if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
1344
+ ::TStringBuilder sb;
1345
+ sb << " Unexpected Resource tag: got '" << resource.GetTag () << " '" ;
1346
+ builder.SetError (sb);
1347
+ return true ;
1348
+ }
1281
1349
BuildSignature<TM64ResourceName, WAccessor>(builder, typesOnly);
1282
1350
return true ;
1283
1351
}
@@ -1500,6 +1568,18 @@ TUnboxedValue GetTimezoneName(const IValueBuilder* valueBuilder, const TUnboxedV
1500
1568
1501
1569
const auto features = NUdf::GetDataTypeInfo (NUdf::GetDataSlot (data.GetTypeId ())).Features ;
1502
1570
if (features & NUdf::BigDateType) {
1571
+ // FIXME: The condition below is required to untie the
1572
+ // Gordian knot with the upgrade, when two MiniKQL
1573
+ // runtimes with different versions are being used.
1574
+ // See YQL-19967 for more info.
1575
+ if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
1576
+ ::TStringBuilder sb;
1577
+ sb << " Invalid argument type: got " ;
1578
+ TTypePrinter (*typeInfoHelper, argType).Out (sb.Out );
1579
+ sb << " , but Resource<" << TMResourceName << " > expected" ;
1580
+ builder.SetError (sb);
1581
+ return true ;
1582
+ }
1503
1583
BuildSignature<TM64ResourceName>(builder, typesOnly);
1504
1584
return true ;
1505
1585
}
@@ -1513,6 +1593,16 @@ TUnboxedValue GetTimezoneName(const IValueBuilder* valueBuilder, const TUnboxedV
1513
1593
}
1514
1594
1515
1595
if (resource.GetTag () == TStringRef::Of (TM64ResourceName)) {
1596
+ // FIXME: The condition below is required to untie the
1597
+ // Gordian knot with the upgrade, when two MiniKQL
1598
+ // runtimes with different versions are being used.
1599
+ // See YQL-19967 for more info.
1600
+ if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
1601
+ ::TStringBuilder sb;
1602
+ sb << " Unexpected Resource tag: got '" << resource.GetTag () << " '" ;
1603
+ builder.SetError (sb);
1604
+ return true ;
1605
+ }
1516
1606
BuildSignature<TM64ResourceName>(builder, typesOnly);
1517
1607
return true ;
1518
1608
}
@@ -1802,6 +1892,18 @@ class TBoundaryOf: public ::NYql::NUdf::TBoxedValue {
1802
1892
1803
1893
const auto features = NUdf::GetDataTypeInfo (NUdf::GetDataSlot (data.GetTypeId ())).Features ;
1804
1894
if (features & NUdf::BigDateType) {
1895
+ // FIXME: The condition below is required to untie the
1896
+ // Gordian knot with the upgrade, when two MiniKQL
1897
+ // runtimes with different versions are being used.
1898
+ // See YQL-19967 for more info.
1899
+ if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
1900
+ ::TStringBuilder sb;
1901
+ sb << " Invalid argument type: got " ;
1902
+ TTypePrinter (*typeInfoHelper, argType).Out (sb.Out );
1903
+ sb << " , but Resource<" << TMResourceName << " > expected" ;
1904
+ builder.SetError (sb);
1905
+ return true ;
1906
+ }
1805
1907
BuildSignature<TM64ResourceName, WBoundary>(builder, typesOnly);
1806
1908
return true ;
1807
1909
}
@@ -1815,6 +1917,16 @@ class TBoundaryOf: public ::NYql::NUdf::TBoxedValue {
1815
1917
}
1816
1918
1817
1919
if (resource.GetTag () == TStringRef::Of (TM64ResourceName)) {
1920
+ // FIXME: The condition below is required to untie the
1921
+ // Gordian knot with the upgrade, when two MiniKQL
1922
+ // runtimes with different versions are being used.
1923
+ // See YQL-19967 for more info.
1924
+ if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
1925
+ ::TStringBuilder sb;
1926
+ sb << " Unexpected Resource tag: got '" << resource.GetTag () << " '" ;
1927
+ builder.SetError (sb);
1928
+ return true ;
1929
+ }
1818
1930
BuildSignature<TM64ResourceName, WBoundary>(builder, typesOnly);
1819
1931
return true ;
1820
1932
}
@@ -2183,6 +2295,18 @@ class TShift : public TBoxedValue {
2183
2295
2184
2296
const auto features = NUdf::GetDataTypeInfo (NUdf::GetDataSlot (data.GetTypeId ())).Features ;
2185
2297
if (features & NUdf::BigDateType) {
2298
+ // FIXME: The condition below is required to untie the
2299
+ // Gordian knot with the upgrade, when two MiniKQL
2300
+ // runtimes with different versions are being used.
2301
+ // See YQL-19967 for more info.
2302
+ if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
2303
+ ::TStringBuilder sb;
2304
+ sb << " Invalid argument type: got " ;
2305
+ TTypePrinter (*typeInfoHelper, argType).Out (sb.Out );
2306
+ sb << " , but Resource<" << TMResourceName << " > expected" ;
2307
+ builder.SetError (sb);
2308
+ return true ;
2309
+ }
2186
2310
BuildSignature<TM64ResourceName, WShifter>(builder, typesOnly);
2187
2311
return true ;
2188
2312
}
@@ -2196,6 +2320,16 @@ class TShift : public TBoxedValue {
2196
2320
}
2197
2321
2198
2322
if (resource.GetTag () == TStringRef::Of (TM64ResourceName)) {
2323
+ // FIXME: The condition below is required to untie the
2324
+ // Gordian knot with the upgrade, when two MiniKQL
2325
+ // runtimes with different versions are being used.
2326
+ // See YQL-19967 for more info.
2327
+ if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
2328
+ ::TStringBuilder sb;
2329
+ sb << " Unexpected Resource tag: got '" << resource.GetTag () << " '" ;
2330
+ builder.SetError (sb);
2331
+ return true ;
2332
+ }
2199
2333
BuildSignature<TM64ResourceName, WShifter>(builder, typesOnly);
2200
2334
return true ;
2201
2335
}
@@ -2293,6 +2427,16 @@ class TShift : public TBoxedValue {
2293
2427
2294
2428
auto resourceType = builder.Resource (TMResourceName);
2295
2429
2430
+ // FIXME: The condition below is required to untie the
2431
+ // Gordian knot with the upgrade, when two MiniKQL
2432
+ // runtimes with different versions are being used.
2433
+ // See YQL-19967 for more info.
2434
+ if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
2435
+ builder.Args ()->Add (resourceType).Flags (ICallablePayload::TArgumentFlags::AutoMap);
2436
+ builder.RunConfig <char *>().Returns <char *>();
2437
+ return true ;
2438
+ }
2439
+
2296
2440
auto stringType = builder.SimpleType <char *>();
2297
2441
2298
2442
auto boolType = builder.SimpleType <bool >();
0 commit comments