diff options
author | vvvv <[email protected]> | 2025-10-08 11:41:14 +0300 |
---|---|---|
committer | vvvv <[email protected]> | 2025-10-08 12:20:42 +0300 |
commit | d73f13cfdb331365ddad0da51ec36e0a3e4cf187 (patch) | |
tree | 88cab10170ce9aa3389be7f1a09247386dcf5ebd /yql/essentials/public/purecalc/common/transformations/utils.cpp | |
parent | f377d8ad9e0741cd904c1d4934afdf24af517d93 (diff) |
YQL-20086 public
commit_hash:68b0c2e9c2960587af7d57ecedcb38f4d05890b7
Diffstat (limited to 'yql/essentials/public/purecalc/common/transformations/utils.cpp')
-rw-r--r-- | yql/essentials/public/purecalc/common/transformations/utils.cpp | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/yql/essentials/public/purecalc/common/transformations/utils.cpp b/yql/essentials/public/purecalc/common/transformations/utils.cpp index 54e0ef7caf8..82d84187a44 100644 --- a/yql/essentials/public/purecalc/common/transformations/utils.cpp +++ b/yql/essentials/public/purecalc/common/transformations/utils.cpp @@ -9,10 +9,10 @@ using namespace NYql::NPureCalc; TExprNode::TPtr NYql::NPureCalc::NodeFromBlocks( const TPositionHandle& pos, const TStructExprType* structType, - TExprContext& ctx -) { + TExprContext& ctx) { const auto items = structType->GetItems(); Y_ENSURE(items.size() > 0); + // clang-format off return ctx.Builder(pos) .Lambda() .Param("stream") @@ -50,30 +50,31 @@ TExprNode::TPtr NYql::NPureCalc::NodeFromBlocks( .Params("fields", items.size()) .Callable("AsStruct") .Do([&](TExprNodeBuilder& parent) -> TExprNodeBuilder& { - ui32 i = 0; - for (const auto& item : items) { - parent.List(i) - .Atom(0, item->GetName()) - .Arg(1, "fields", i++) - .Seal(); - } - return parent; - }) + ui32 i = 0; + for (const auto& item : items) { + parent.List(i) + .Atom(0, item->GetName()) + .Arg(1, "fields", i++) + .Seal(); + } + return parent; + }) .Seal() .Seal() .Seal() .Seal() .Seal() .Build(); + // clang-format on } TExprNode::TPtr NYql::NPureCalc::NodeToBlocks( const TPositionHandle& pos, const TStructExprType* structType, - TExprContext& ctx -) { + TExprContext& ctx) { const auto items = structType->GetItems(); Y_ENSURE(items.size() > 0); + // clang-format off return ctx.Builder(pos) .Lambda() .Param("stream") @@ -126,6 +127,7 @@ TExprNode::TPtr NYql::NPureCalc::NodeToBlocks( .Seal() .Seal() .Build(); + // clang-format on } TExprNode::TPtr NYql::NPureCalc::ApplyToIterable( @@ -133,9 +135,9 @@ TExprNode::TPtr NYql::NPureCalc::ApplyToIterable( const TExprNode::TPtr iterable, const TExprNode::TPtr lambda, bool wrapLMap, - TExprContext& ctx -) { + TExprContext& ctx) { if (wrapLMap) { + // clang-format off return ctx.Builder(pos) .Callable("LMap") .Add(0, iterable) @@ -147,19 +149,21 @@ TExprNode::TPtr NYql::NPureCalc::ApplyToIterable( .Seal() .Seal() .Build(); + // clang-format on } else { + // clang-format off return ctx.Builder(pos) .Apply(lambda) .With(0, iterable) .Seal() .Build(); + // clang-format on } } const TStructExprType* NYql::NPureCalc::WrapBlockStruct( const TStructExprType* structType, - TExprContext& ctx -) { + TExprContext& ctx) { TVector<const TItemExprType*> members; for (const auto& item : structType->GetItems()) { const auto blockItemType = ctx.MakeType<TBlockExprType>(item->GetItemType()); @@ -172,8 +176,7 @@ const TStructExprType* NYql::NPureCalc::WrapBlockStruct( const TStructExprType* NYql::NPureCalc::UnwrapBlockStruct( const TStructExprType* structType, - TExprContext& ctx -) { + TExprContext& ctx) { TVector<const TItemExprType*> members; for (const auto& item : structType->GetItems()) { if (item->GetName() == PurecalcBlockColumnLength) { |