Skip to content

Commit 2aed62b

Browse files
committed
Tweak DeclareSignature for TParse class
1 parent 21d580f commit 2aed62b

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

yql/essentials/sql/v1/builtin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3471,7 +3471,7 @@ TNodePtr BuildBuiltinFunc(TContext& ctx, TPosition pos, TString name, const TVec
34713471

34723472
return BuildUdf(ctx, pos, moduleName, name, newArgs);
34733473
}
3474-
} else if (MKQL_RUNTIME_VERSION < 51U && ns == "datetime2" && name == "Format") {
3474+
} else if (MKQL_RUNTIME_VERSION < 51U && ns == "datetime2" && (name == "Format" || name == "Parse")) {
34753475
// FIXME: The condition above is required to untie the
34763476
// Gordian knot with the upgrade, when two MiniKQL
34773477
// runtimes with different versions are being used.

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3339,6 +3339,22 @@ class TShift : public TBoxedValue {
33393339
return false;
33403340
}
33413341

3342+
// FIXME: The condition below is required to untie the
3343+
// Gordian knot with the upgrade, when two MiniKQL
3344+
// runtimes with different versions are being used.
3345+
// See YQL-19967 for more info.
3346+
if (MKQL_RUNTIME_VERSION < 51U && typesOnly && name == "Parse") {
3347+
auto resourceType = builder.Resource(TMResourceName);
3348+
auto optionalResourceType = builder.Optional()->Item(resourceType).Build();
3349+
3350+
builder.Args()->Add<char*>().Flags(ICallablePayload::TArgumentFlags::AutoMap)
3351+
.Add(builder.Optional()->Item<ui16>())
3352+
.Done()
3353+
.OptionalArgs(1);
3354+
builder.RunConfig<char*>().Returns(optionalResourceType);
3355+
return true;
3356+
}
3357+
33423358
builder.OptionalArgs(1).Args()->Add<char*>()
33433359
.template Add<TOptional<ui16>>();
33443360
builder.Returns(

0 commit comments

Comments
 (0)