diff options
author | galaxycrab <UgnineSirdis@ydb.tech> | 2023-03-13 16:03:58 +0300 |
---|---|---|
committer | galaxycrab <UgnineSirdis@ydb.tech> | 2023-03-13 16:03:58 +0300 |
commit | 286b1d4a5b7392cde22e147aaa769ef45ac10819 (patch) | |
tree | 07b04945eed57ce9f55de3fb989a0ce53d2bbaaf | |
parent | 807cff53be4058c3a68f1416925949b9377b08a6 (diff) | |
download | ydb-286b1d4a5b7392cde22e147aaa769ef45ac10819.tar.gz |
Move BuildQuery to logical transformer to execute before physical transformers with TrimReadWorld
-rw-r--r-- | ydb/core/kqp/provider/yql_kikimr_opt.cpp | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/ydb/core/kqp/provider/yql_kikimr_opt.cpp b/ydb/core/kqp/provider/yql_kikimr_opt.cpp index ca3dfce32ef..f645e6a1a70 100644 --- a/ydb/core/kqp/provider/yql_kikimr_opt.cpp +++ b/ydb/core/kqp/provider/yql_kikimr_opt.cpp @@ -43,25 +43,12 @@ TExprNode::TPtr KiEmptyCommit(TExprBase node) { TAutoPtr<IGraphTransformer> CreateKiLogicalOptProposalTransformer(TIntrusivePtr<TKikimrSessionContext> sessionCtx, TTypeAnnotationContext& types) { - Y_UNUSED(sessionCtx); Y_UNUSED(types); - return CreateFunctorTransformer([](const TExprNode::TPtr& input, TExprNode::TPtr& output, - TExprContext& ctx) - { - Y_UNUSED(input); - Y_UNUSED(output); - Y_UNUSED(ctx); - - return IGraphTransformer::TStatus::Ok; - }); -} - -TAutoPtr<IGraphTransformer> CreateKiPhysicalOptProposalTransformer(TIntrusivePtr<TKikimrSessionContext> sessionCtx) { return CreateFunctorTransformer([sessionCtx](const TExprNode::TPtr& input, TExprNode::TPtr& output, TExprContext& ctx) { - typedef IGraphTransformer::TStatus TStatus; + using TStatus = IGraphTransformer::TStatus; TStatus status = OptimizeExpr(input, output, [sessionCtx](const TExprNode::TPtr& inputNode, TExprContext& ctx) { auto ret = inputNode; @@ -93,11 +80,17 @@ TAutoPtr<IGraphTransformer> CreateKiPhysicalOptProposalTransformer(TIntrusivePtr return ret; }, ctx, TOptimizeExprSettings(nullptr)); - if (status.Level != IGraphTransformer::TStatus::Ok) { - return status; - } + return status; + }); +} + +TAutoPtr<IGraphTransformer> CreateKiPhysicalOptProposalTransformer(TIntrusivePtr<TKikimrSessionContext> sessionCtx) { + return CreateFunctorTransformer([sessionCtx](const TExprNode::TPtr& input, TExprNode::TPtr& output, + TExprContext& ctx) + { + using TStatus = IGraphTransformer::TStatus; - status = OptimizeExpr(input, output, [sessionCtx](const TExprNode::TPtr& inputNode, TExprContext& ctx) { + TStatus status = OptimizeExpr(input, output, [sessionCtx](const TExprNode::TPtr& inputNode, TExprContext& ctx) { Y_UNUSED(ctx); auto ret = inputNode; |