@@ -269,6 +269,18 @@ class TToUnits {
269
269
builder.Args ()->Add (argsTuple.GetElementType (0 ));
270
270
const TType* retType;
271
271
if (features & NUdf::ExtDateType) {
272
+ // FIXME: The condition below is required to untie the
273
+ // Gordian knot with the upgrade, when two MiniKQL
274
+ // runtimes with different versions are being used.
275
+ // See YQL-19967 for more info.
276
+ if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
277
+ ::TStringBuilder sb;
278
+ sb << " Invalid argument type: got " ;
279
+ TTypePrinter (*typeInfoHelper, argType).Out (sb.Out );
280
+ sb << " , but one of Date/Datetime/Timestamp/TzDate/TzDatetime/TzTimestamp/Interval expected" ;
281
+ builder.SetError (sb);
282
+ return true ;
283
+ }
272
284
retType = builder.SimpleType <TWResult>();
273
285
} else if (features & NUdf::TimeIntervalType) {
274
286
retType = builder.SimpleType <TSignedResult>();
@@ -2023,6 +2035,18 @@ class TToConverter : public TBoxedValue {
2023
2035
const auto features = NUdf::GetDataTypeInfo (NUdf::GetDataSlot (data.GetTypeId ())).Features ;
2024
2036
if (features & NUdf::TimeIntervalType) {
2025
2037
if (features & NUdf::ExtDateType) {
2038
+ // FIXME: The condition below is required to untie the
2039
+ // Gordian knot with the upgrade, when two MiniKQL
2040
+ // runtimes with different versions are being used.
2041
+ // See YQL-19967 for more info.
2042
+ if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
2043
+ ::TStringBuilder sb;
2044
+ sb << " Invalid argument type: got " ;
2045
+ TTypePrinter (*typeInfoHelper, argType).Out (sb.Out );
2046
+ sb << " , but Interval expected" ;
2047
+ builder.SetError (sb);
2048
+ return true ;
2049
+ }
2026
2050
BuildSignature<TInterval64, TWResult>(builder, typesOnly);
2027
2051
} else {
2028
2052
BuildSignature<TInterval, TResult>(builder, typesOnly);
@@ -2498,6 +2522,18 @@ class TBoundaryOfInterval: public ::NYql::NUdf::TBoxedValue {
2498
2522
2499
2523
const auto features = NUdf::GetDataTypeInfo (NUdf::GetDataSlot (data.GetTypeId ())).Features ;
2500
2524
if (features & NUdf::ExtDateType) {
2525
+ // FIXME: The condition below is required to untie the
2526
+ // Gordian knot with the upgrade, when two MiniKQL
2527
+ // runtimes with different versions are being used.
2528
+ // See YQL-19967 for more info.
2529
+ if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
2530
+ ::TStringBuilder sb;
2531
+ sb << " Invalid argument type: got " ;
2532
+ TTypePrinter (*typeInfoHelper, argType).Out (sb.Out );
2533
+ sb << " , but Resource<" << TMResourceName << " > expected" ;
2534
+ builder.SetError (sb);
2535
+ return true ;
2536
+ }
2501
2537
BuildSignature<TM64ResourceName, WBoundary>(builder, typesOnly);
2502
2538
return true ;
2503
2539
}
@@ -2620,6 +2656,18 @@ class TTimeOfDay: public ::NYql::NUdf::TBoxedValue {
2620
2656
2621
2657
const auto features = NUdf::GetDataTypeInfo (NUdf::GetDataSlot (data.GetTypeId ())).Features ;
2622
2658
if (features & NUdf::ExtDateType) {
2659
+ // FIXME: The condition below is required to untie the
2660
+ // Gordian knot with the upgrade, when two MiniKQL
2661
+ // runtimes with different versions are being used.
2662
+ // See YQL-19967 for more info.
2663
+ if (MKQL_RUNTIME_VERSION < 51U && typesOnly) {
2664
+ ::TStringBuilder sb;
2665
+ sb << " Invalid argument type: got " ;
2666
+ TTypePrinter (*typeInfoHelper, argType).Out (sb.Out );
2667
+ sb << " , but Resource<" << TMResourceName << " > expected" ;
2668
+ builder.SetError (sb);
2669
+ return true ;
2670
+ }
2623
2671
BuildSignature<TM64ResourceName>(builder, typesOnly);
2624
2672
return true ;
2625
2673
}
0 commit comments