Skip to content

Commit 5a1a8f9

Browse files
committed
Tweak DeclareSignature for TFormat class
1 parent 75b1be1 commit 5a1a8f9

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

yql/essentials/sql/v1/builtin.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include <yql/essentials/public/issue/yql_issue_id.h>
1313
#include <yql/essentials/parser/pg_catalog/catalog.h>
1414

15+
#include <yql/essentials/minikql/mkql_runtime_version.h>
16+
1517
#include <library/cpp/charset/ci_string.h>
1618
#include <library/cpp/yson/node/node_io.h>
1719
#include <util/string/builder.h>
@@ -3471,6 +3473,12 @@ TNodePtr BuildBuiltinFunc(TContext& ctx, TPosition pos, TString name, const TVec
34713473
}
34723474
} else if (ns == "datetime2" && (name == "Parse")) {
34733475
return BuildUdf(ctx, pos, nameSpace, name, args);
3476+
} else if (MKQL_RUNTIME_VERSION < 51U && ns == "datetime2" && name == "Format") {
3477+
// FIXME: The condition above is required to untie the
3478+
// Gordian knot with the upgrade, when two MiniKQL
3479+
// runtimes with different versions are being used.
3480+
// See YQL-19967 for more info.
3481+
return BuildUdf(ctx, pos, nameSpace, name, args);
34743482
} else if (ns == "pg" || ns == "pgagg" || ns == "pgproc") {
34753483
bool isAggregateFunc = NYql::NPg::HasAggregation(name, NYql::NPg::EAggKind::Normal);
34763484
bool isNormalFunc = NYql::NPg::HasProc(name, NYql::NPg::EProcKind::Function);

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#include <yql/essentials/minikql/datetime/datetime.h>
55
#include <yql/essentials/minikql/datetime/datetime64.h>
66

7+
#include <yql/essentials/minikql/mkql_runtime_version.h>
8+
79
#include <yql/essentials/public/udf/arrow/udf_arrow_helpers.h>
810

911
#include <util/datetime/base.h>
@@ -2293,6 +2295,16 @@ class TShift : public TBoxedValue {
22932295

22942296
auto resourceType = builder.Resource(TMResourceName);
22952297

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+
builder.Args()->Add(resourceType).Flags(ICallablePayload::TArgumentFlags::AutoMap);
2304+
builder.RunConfig<char*>().Returns<char*>();
2305+
return true;
2306+
}
2307+
22962308
auto stringType = builder.SimpleType<char*>();
22972309

22982310
auto boolType = builder.SimpleType<bool>();

0 commit comments

Comments
 (0)