summaryrefslogtreecommitdiffstats
path: root/yql/essentials/tools/sql2yql/sql2yql.cpp
diff options
context:
space:
mode:
authorrobot-piglet <[email protected]>2024-12-15 21:56:51 +0300
committerrobot-piglet <[email protected]>2024-12-15 22:09:57 +0300
commit88aed30c561038cf7f5915c0f8cc9794309d5d43 (patch)
tree0bcce3a670026a937558b843ab656b1b55919a7b /yql/essentials/tools/sql2yql/sql2yql.cpp
parent10cdc08290a7c15adeeaf4cbf775f88b66473025 (diff)
Intermediate changes
commit_hash:ae0ad14edeb2d2c7b99cdcc642c9e70e882b4a65
Diffstat (limited to 'yql/essentials/tools/sql2yql/sql2yql.cpp')
-rw-r--r--yql/essentials/tools/sql2yql/sql2yql.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/yql/essentials/tools/sql2yql/sql2yql.cpp b/yql/essentials/tools/sql2yql/sql2yql.cpp
index 7ab13f2d855..dd313b451cb 100644
--- a/yql/essentials/tools/sql2yql/sql2yql.cpp
+++ b/yql/essentials/tools/sql2yql/sql2yql.cpp
@@ -103,9 +103,7 @@ bool TestFormat(
Cerr << "Failed to format query: " << issues.ToString() << Endl;
return false;
}
- NYql::TAstParseResult frmParseRes = NSQLTranslation::SqlToYql(query, settings);
- TStringStream frmYqlProgram;
- frmParseRes.Root->PrettyPrintTo(frmYqlProgram, NYql::TAstPrintFlags::PerLine | NYql::TAstPrintFlags::ShortQuote);
+ NYql::TAstParseResult frmParseRes = NSQLTranslation::SqlToYql(frmQuery, settings);
if (!frmParseRes.Issues.Empty()) {
frmParseRes.Issues.PrintWithProgramTo(Cerr, queryFile, frmQuery);
if (AnyOf(frmParseRes.Issues, [](const auto& issue) { return issue.GetSeverity() == NYql::TSeverityIds::S_ERROR;})) {
@@ -116,6 +114,8 @@ bool TestFormat(
Cerr << "No error reported, but no yql compiled result!" << Endl << Endl;
return false;
}
+ TStringStream frmYqlProgram;
+ frmParseRes.Root->PrettyPrintTo(frmYqlProgram, NYql::TAstPrintFlags::PerLine | NYql::TAstPrintFlags::ShortQuote);
if (yqlProgram.Str() != frmYqlProgram.Str()) {
Cerr << "source query's AST and formatted query's AST are not same\n";
return false;