summaryrefslogtreecommitdiffstats
path: root/yt
diff options
context:
space:
mode:
authorvvvv <[email protected]>2025-02-03 18:31:19 +0300
committervvvv <[email protected]>2025-02-03 18:49:39 +0300
commitdee5ef359ee7e109cc0112fbfa66ab696ecf489e (patch)
tree78d754c1356798f810d1fba93d4e750822aed494 /yt
parentecde3f416d4cae1755ae836807298f101b091c4d (diff)
Support Udf settings along with ScriptUdf in YT expr traits
init commit_hash:ebd39f1619c60fc10e21961b0df0c4539ff2b991
Diffstat (limited to 'yt')
-rw-r--r--yt/yql/providers/yt/lib/expr_traits/yql_expr_traits.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/yt/yql/providers/yt/lib/expr_traits/yql_expr_traits.cpp b/yt/yql/providers/yt/lib/expr_traits/yql_expr_traits.cpp
index 0e2e6de57fb..a55d9baf659 100644
--- a/yt/yql/providers/yt/lib/expr_traits/yql_expr_traits.cpp
+++ b/yt/yql/providers/yt/lib/expr_traits/yql_expr_traits.cpp
@@ -70,6 +70,21 @@ namespace NYql {
if (memoryUsage && node.Child(0)->Content().StartsWith("UserSessions.")) {
(*memoryUsage)["UserSessions module"] = 512_MB; // Take into account only once
}
+
+ if (cpuUsage) {
+ if (auto cpuSetting = GetSetting(*node.Child(7), "cpu")) {
+ double usage = FromString<double>(cpuSetting->Child(1)->Content());
+ if (auto prev = cpuUsage->FindPtr("Udf from settings arg")) {
+ usage *= *prev;
+ }
+ (*cpuUsage)["Udf from settings arg"] = usage;
+ }
+ }
+ if (memoryUsage) {
+ if (auto extraMemSetting = GetSetting(*node.Child(7), "extraMem")) {
+ (*memoryUsage)["Udf from settings arg"] += FromString<ui64>(extraMemSetting->Child(1)->Content());
+ }
+ }
}
if (NNodes::TYtTableContent::Match(&node)) {