MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / isCompilableFunction

Function isCompilableFunction

src/Interpreters/ExpressionJIT.cpp:355–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353}
354
355static bool isCompilableFunction(const ActionsDAG::Node & node, const std::unordered_set<const ActionsDAG::Node *> & lazy_executed_nodes)
356{
357 if (node.type != ActionsDAG::ActionType::FUNCTION)
358 return false;
359
360 const auto & function = *node.function_base;
361
362 IFunction::ShortCircuitSettings settings;
363 if (function.isShortCircuit(settings, node.children.size()))
364 {
365 for (const auto & child : node.children)
366 {
367 const ActionsDAG::Node * child_no_alias = removeAliasIfNecessary(child);
368
369 if (lazy_executed_nodes.contains(child_no_alias))
370 return false;
371 }
372 }
373
374 if (!canBeNativeType(*function.getResultType()))
375 {
376 return false;
377 }
378
379 const auto & argument_types = function.getArgumentTypes();
380 auto skip_arguments = function.getArgumentsThatDontParticipateInCompilation(argument_types);
381 for (size_t i = 0; i < argument_types.size(); ++i)
382 {
383 if (std::find(skip_arguments.begin(), skip_arguments.end(), i) != skip_arguments.end())
384 continue;
385
386 const auto & type = argument_types[i];
387 if (!canBeNativeType(*type))
388 {
389 return false;
390 }
391 }
392
393 return function.isCompilable();
394}
395
396static CompileDAG getCompilableDAG(
397 const ActionsDAG::Node * root,

Callers 2

getCompilableDAGFunction · 0.85
compileFunctionsMethod · 0.85

Calls 12

removeAliasIfNecessaryFunction · 0.85
getArgumentTypesMethod · 0.80
canBeNativeTypeFunction · 0.50
findFunction · 0.50
isShortCircuitMethod · 0.45
sizeMethod · 0.45
containsMethod · 0.45
getResultTypeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
isCompilableMethod · 0.45

Tested by

no test coverage detected