Skip to content

Commit 4c98180

Browse files
committed
[CBO] Hints warning messages improvement
1 parent 0cd4902 commit 4c98180

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

ydb/core/kqp/opt/logical/kqp_opt_log.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,10 @@ class TKqpLogicalOptTransformer : public TOptimizeTransformerBase {
9292
TStatus DoTransform(TExprNode::TPtr input, TExprNode::TPtr& output, TExprContext& ctx) override {
9393
auto status = TOptimizeTransformerBase::DoTransform(input, output, ctx);
9494

95-
for (const auto& hint: KqpCtx.GetOptimizerHints().GetUnappliedString()) {
96-
ctx.AddWarning(YqlIssue({}, TIssuesIds::YQL_UNUSED_HINT, "Unapplied hint: " + hint));
95+
if (status == TStatus::Ok) {
96+
for (const auto& hint: KqpCtx.GetOptimizerHints().GetUnappliedString()) {
97+
ctx.AddWarning(YqlIssue({}, TIssuesIds::YQL_UNUSED_HINT, "Unapplied hint: " + hint));
98+
}
9799
}
98100

99101
return status;

ydb/library/yql/core/cbo/cbo_hints.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ class TOptimizerHintsParser {
4646
}
4747

4848
void JoinAlgo() {
49-
Keyword({"("});
50-
5149
i32 beginPos = Pos + 1;
50+
51+
Keyword({"("});
5252

5353
i32 labelsBeginPos = Pos + 1;
5454
TVector<TString> labels = CollectLabels();
@@ -65,7 +65,7 @@ class TOptimizerHintsParser {
6565

6666
for (const auto& [joinAlgo, joinAlgoStr]: Zip(joinAlgos, joinAlgosStr)) {
6767
if (reqJoinAlgoStr == joinAlgoStr) {
68-
Hints.JoinAlgoHints->PushBack(std::move(labels), joinAlgo, "JoinOrder" + Text.substr(beginPos, Pos - beginPos + 1));
68+
Hints.JoinAlgoHints->PushBack(std::move(labels), joinAlgo, "JoinAlgo" + Text.substr(beginPos, Pos - beginPos + 1));
6969
return;
7070
}
7171
}

0 commit comments

Comments
 (0)