MCPcopy Create free account
hub / github.com/bytedance/bolt / registerSubscriptFunction

Function registerSubscriptFunction

bolt/functions/prestosql/Subscript.cpp:57–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55} // namespace
56
57void registerSubscriptFunction(
58 const std::string& name,
59 bool enableCaching = true) {
60 exec::registerStatefulVectorFunction(
61 name,
62 SubscriptFunction::signatures(),
63 [enableCaching](
64 const std::string&,
65 const std::vector<exec::VectorFunctionArg>& inputArgs,
66 const bolt::core::QueryConfig& config) {
67 static const auto kSubscriptStateLess =
68 std::make_shared<SubscriptFunction>(false);
69 if (inputArgs[0].type->isArray()) {
70 return kSubscriptStateLess;
71 } else {
72 return std::make_shared<SubscriptFunction>(
73 enableCaching && config.isExpressionEvaluationCacheEnabled());
74 }
75 });
76}
77
78BOLT_DECLARE_VECTOR_FUNCTION(
79 udf_subscript,

Callers 2

registerGeneralFunctionsFunction · 0.85
mainFunction · 0.85

Calls 3

signaturesFunction · 0.70

Tested by

no test coverage detected