Skip to content

Commit 56233d0

Browse files
committed
YQL-19967: Use callable node type for validation
Follows up 8aa01a548ffd87f8f1f6aa6df7eeddb66dad1a27 commit_hash:ffa5903aa158251203c518e80ad2e8af98b20290 (cherry picked from commit 42258a1)
1 parent f009fcf commit 56233d0

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

yql/essentials/minikql/comp_nodes/mkql_udf.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,15 @@ using TBaseComputation = TMutableCodegeneratorPtrNode<TUdfWrapper<TValidatePolic
173173
NUdf::TSourcePosition pos,
174174
IComputationNode* runConfigNode,
175175
ui32 runConfigArgs,
176-
const TCallableType* functionType,
176+
const TCallableType* callableType,
177177
TType* userType)
178178
: TBaseComputation(mutables, EValueRepresentation::Boxed)
179179
, FunctionName(std::move(functionName))
180180
, TypeConfig(std::move(typeConfig))
181181
, Pos(pos)
182182
, RunConfigNode(runConfigNode)
183183
, RunConfigArgs(runConfigArgs)
184-
, FunctionType(functionType)
184+
, CallableType(callableType)
185185
, UserType(userType)
186186
, UdfIndex(mutables.CurValueIndex++)
187187
{
@@ -267,7 +267,7 @@ using TBaseComputation = TMutableCodegeneratorPtrNode<TUdfWrapper<TValidatePolic
267267

268268
void Wrap(NUdf::TUnboxedValue& callable) const {
269269
MKQL_ENSURE(bool(callable), "Returned empty value in function: " << FunctionName);
270-
TValidate<TValidatePolicy,TValidateMode>::WrapCallable(FunctionType, callable, TStringBuilder() << "FunctionWithConfig<" << FunctionName << ">");
270+
TValidate<TValidatePolicy,TValidateMode>::WrapCallable(CallableType, callable, TStringBuilder() << "FunctionWithConfig<" << FunctionName << ">");
271271
}
272272

273273
void RegisterDependencies() const final {
@@ -279,7 +279,7 @@ using TBaseComputation = TMutableCodegeneratorPtrNode<TUdfWrapper<TValidatePolic
279279
const NUdf::TSourcePosition Pos;
280280
IComputationNode* const RunConfigNode;
281281
const ui32 RunConfigArgs;
282-
const TCallableType* FunctionType;
282+
const TCallableType* CallableType;
283283
TType* const UserType;
284284
const ui32 UdfIndex;
285285
};
@@ -422,7 +422,7 @@ IComputationNode* WrapUdf(TCallable& callable, const TComputationNodeFactoryCont
422422
const auto runConfigArgs = funcInfo.FunctionType->GetArgumentsCount();
423423
return runConfigNodeType->IsVoid()
424424
? CreateUdfWrapper<true>(ctx, std::move(funcName), std::move(typeConfig), pos, callableNodeType, callableFuncType, userType)
425-
: CreateUdfWrapper<false>(ctx, std::move(funcName), std::move(typeConfig), pos, runConfigCompNode, runConfigArgs, callableFuncType, userType);
425+
: CreateUdfWrapper<false>(ctx, std::move(funcName), std::move(typeConfig), pos, runConfigCompNode, runConfigArgs, callableNodeType, userType);
426426
}
427427
MKQL_ENSURE(callableFuncType->IsConvertableTo(*callableNodeType, true),
428428
"Function '" << funcName << "' type mismatch, expected return type: " << PrintNode(callableNodeType, true) <<
@@ -440,7 +440,7 @@ IComputationNode* WrapUdf(TCallable& callable, const TComputationNodeFactoryCont
440440
}
441441

442442
const auto runCfgCompNode = LocateNode(ctx.NodeLocator, *runCfgNode.GetNode());
443-
return CreateUdfWrapper<false>(ctx, std::move(funcName), std::move(typeConfig), pos, runCfgCompNode, 1U, callableFuncType, userType);
443+
return CreateUdfWrapper<false>(ctx, std::move(funcName), std::move(typeConfig), pos, runCfgCompNode, 1U, callableNodeType, userType);
444444
}
445445

446446
IComputationNode* WrapScriptUdf(TCallable& callable, const TComputationNodeFactoryContext& ctx) {

yql/essentials/minikql/comp_nodes/ut/mkql_computation_node_ut.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ struct TSetup {
118118
Reset();
119119
Explorer.Walk(pgm.GetNode(), *Env);
120120
TComputationPatternOpts opts(Alloc.Ref(), *Env, NodeFactory,
121-
FunctionRegistry.Get(), NUdf::EValidateMode::None, NUdf::EValidatePolicy::Exception,
121+
FunctionRegistry.Get(), NUdf::EValidateMode::Greedy, NUdf::EValidatePolicy::Exception,
122122
UseLLVM ? "" : "OFF", graphPerProcess, StatsRegistry.Get(), nullptr, nullptr);
123123
Pattern = MakeComputationPattern(Explorer, pgm, entryPoints, opts);
124124
auto graph = Pattern->Clone(opts.ToComputationOptions(*RandomProvider, *TimeProvider));

0 commit comments

Comments
 (0)