Skip to content

Commit 21a9320

Browse files
committed
Fixed issues
1 parent 7cc17a9 commit 21a9320

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

ydb/tests/tools/kqprun/kqprun.cpp

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,11 @@ struct TExecutionOptions {
249249
ythrow yexception() << "Trace opt id allowed only for trace opt type script (used " << runnerOptions.TraceOptType << ")";
250250
}
251251

252-
const ui64 numberScripts = ScriptQueries.size() * LoopCount;
253-
if (*traceOptId >= numberScripts) {
254-
ythrow yexception() << "Invalid trace opt id " << *traceOptId << ", it should be less than number of scipt queries " << numberScripts;
252+
const ui64 scriptNumber = ScriptQueries.size() * LoopCount;
253+
if (*traceOptId >= scriptNumber) {
254+
ythrow yexception() << "Invalid trace opt id " << *traceOptId << ", it should be less than number of script queries " << scriptNumber;
255255
}
256-
if (numberScripts == 1) {
256+
if (scriptNumber == 1) {
257257
Cout << colors.Red() << "Warning: trace opt id is not necessary for single script mode" << Endl;
258258
}
259259
}
@@ -546,10 +546,9 @@ class TMain : public TMainClassArgs {
546546
if (tableName.empty() || filePath.empty()) {
547547
ythrow yexception() << "Incorrect table mapping, expected form table@file, e. g. yt.Root/[email protected]";
548548
}
549-
if (TablesMapping.contains(tableName)) {
549+
if (!TablesMapping.emplace(tableName, filePath).second) {
550550
ythrow yexception() << "Got duplicated table name: " << tableName;
551551
}
552-
TablesMapping[tableName] = filePath;
553552
});
554553

555554
options.AddLongOption('c', "app-config", "File with app config (TAppConfig for ydb tenant)")
@@ -614,15 +613,14 @@ class TMain : public TMainClassArgs {
614613
ythrow yexception() << "Incorrect log setting, expected form component=priority, e. g. KQP_YQL=trace";
615614
}
616615

617-
const auto service = GetLogService(TString(component));
618-
if (LogPriorities.contains(service)) {
619-
ythrow yexception() << "Got duplicated log service name: " << component;
620-
}
621-
622616
if (!logPriority.Contains(TString(priority))) {
623617
ythrow yexception() << "Incorrect log priority: " << priority;
624618
}
625-
LogPriorities[service] = logPriority(TString(priority));
619+
620+
const auto service = GetLogService(TString(component));
621+
if (!LogPriorities.emplace(service, logPriority(TString(priority))).second) {
622+
ythrow yexception() << "Got duplicated log service name: " << component;
623+
}
626624
});
627625

628626
TChoices<TRunnerOptions::ETraceOptType> traceOpt({
@@ -631,7 +629,7 @@ class TMain : public TMainClassArgs {
631629
{"script", TRunnerOptions::ETraceOptType::Script},
632630
{"disabled", TRunnerOptions::ETraceOptType::Disabled}
633631
});
634-
options.AddLongOption('T', "trace-opt", "Print AST in the begin of each transformation (use script@<query id> for tracing one -p query)")
632+
options.AddLongOption('T', "trace-opt", "Print AST in the begin of each transformation")
635633
.RequiredArgument("trace-opt-query")
636634
.DefaultValue("disabled")
637635
.Choices(traceOpt.GetChoices())

0 commit comments

Comments
 (0)