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.h | |
parent | f377d8ad9e0741cd904c1d4934afdf24af517d93 (diff) |
YQL-20086 public
commit_hash:68b0c2e9c2960587af7d57ecedcb38f4d05890b7
Diffstat (limited to 'yql/essentials/public/purecalc/common/transformations/utils.h')
-rw-r--r-- | yql/essentials/public/purecalc/common/transformations/utils.h | 143 |
1 files changed, 69 insertions, 74 deletions
diff --git a/yql/essentials/public/purecalc/common/transformations/utils.h b/yql/essentials/public/purecalc/common/transformations/utils.h index cc8849b7e3a..c2ddf299ce3 100644 --- a/yql/essentials/public/purecalc/common/transformations/utils.h +++ b/yql/essentials/public/purecalc/common/transformations/utils.h @@ -3,81 +3,76 @@ #include <yql/essentials/core/yql_graph_transformer.h> namespace NYql { - namespace NPureCalc { - /** - * A transformer which wraps the given input node with the pipeline - * converting the input type to the block one. - * - * @param pos the position of the given node to be rewritten. - * @param structType the item type of the container provided by the node. - * @param ctx the context to make ExprNode rewrites. - * @return the resulting ExprNode. - */ - TExprNode::TPtr NodeFromBlocks( - const TPositionHandle& pos, - const TStructExprType* structType, - TExprContext& ctx - ); +namespace NPureCalc { +/** + * A transformer which wraps the given input node with the pipeline + * converting the input type to the block one. + * + * @param pos the position of the given node to be rewritten. + * @param structType the item type of the container provided by the node. + * @param ctx the context to make ExprNode rewrites. + * @return the resulting ExprNode. + */ +TExprNode::TPtr NodeFromBlocks( + const TPositionHandle& pos, + const TStructExprType* structType, + TExprContext& ctx); - /** - * A transformer which wraps the given root node with the pipeline - * converting the output type to the block one. - * - * @param pos the position of the given node to be rewritten. - * @param structType the item type of the container provided by the node. - * @param ctx the context to make ExprNode rewrites. - * @return the resulting ExprNode. - */ - TExprNode::TPtr NodeToBlocks( - const TPositionHandle& pos, - const TStructExprType* structType, - TExprContext& ctx - ); +/** + * A transformer which wraps the given root node with the pipeline + * converting the output type to the block one. + * + * @param pos the position of the given node to be rewritten. + * @param structType the item type of the container provided by the node. + * @param ctx the context to make ExprNode rewrites. + * @return the resulting ExprNode. + */ +TExprNode::TPtr NodeToBlocks( + const TPositionHandle& pos, + const TStructExprType* structType, + TExprContext& ctx); - /** - * A transformer to apply the given lambda to the given iterable (either - * list or stream). If the iterable is list, the lambda should be passed - * to the <LMap> callable; if the iterable is stream, the lambda should - * be applied right to the iterable. - * - * @param pos the position of the given node to be rewritten. - * @param iterable the node, that provides the iterable to be processed. - * @param lambda the node, that provides lambda to be applied. - * @param wrapLMap indicator to wrap the result with LMap callable. - * @oaram ctx the context to make ExprNode rewrites. - */ - TExprNode::TPtr ApplyToIterable( - const TPositionHandle& pos, - const TExprNode::TPtr iterable, - const TExprNode::TPtr lambda, - bool wrapLMap, - TExprContext& ctx - ); +/** + * A transformer to apply the given lambda to the given iterable (either + * list or stream). If the iterable is list, the lambda should be passed + * to the <LMap> callable; if the iterable is stream, the lambda should + * be applied right to the iterable. + * + * @param pos the position of the given node to be rewritten. + * @param iterable the node, that provides the iterable to be processed. + * @param lambda the node, that provides lambda to be applied. + * @param wrapLMap indicator to wrap the result with LMap callable. + * @oaram ctx the context to make ExprNode rewrites. + */ +TExprNode::TPtr ApplyToIterable( + const TPositionHandle& pos, + const TExprNode::TPtr iterable, + const TExprNode::TPtr lambda, + bool wrapLMap, + TExprContext& ctx); - /** - * A helper which wraps the items of the given struct with the block - * type container and appends the new item for _yql_block_length column. - * - * @param structType original struct to be wrapped. - * @param ctx the context to make ExprType rewrite. - * @return the new struct with block items. - */ - const TStructExprType* WrapBlockStruct( - const TStructExprType* structType, - TExprContext& ctx - ); +/** + * A helper which wraps the items of the given struct with the block + * type container and appends the new item for _yql_block_length column. + * + * @param structType original struct to be wrapped. + * @param ctx the context to make ExprType rewrite. + * @return the new struct with block items. + */ +const TStructExprType* WrapBlockStruct( + const TStructExprType* structType, + TExprContext& ctx); - /** - * A helper which unwraps the block container from the items of the - * given struct and removes the item for _yql_block_length column. - * - * @param structType original struct to be unwrapped. - * @param ctx the context to make ExprType rewrite. - * @return the new struct without block items. - */ - const TStructExprType* UnwrapBlockStruct( - const TStructExprType* structType, - TExprContext& ctx - ); - } -} +/** + * A helper which unwraps the block container from the items of the + * given struct and removes the item for _yql_block_length column. + * + * @param structType original struct to be unwrapped. + * @param ctx the context to make ExprType rewrite. + * @return the new struct without block items. + */ +const TStructExprType* UnwrapBlockStruct( + const TStructExprType* structType, + TExprContext& ctx); +} // namespace NPureCalc +} // namespace NYql |