Skip to content

Commit 23474d6

Browse files
committed
Intermediate changes
commit_hash:b7af32a044e61298c718faab65887c6d8725b4c8
1 parent a27b6a9 commit 23474d6

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

yql/tools/yqlrun/ya.make

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ PEERDIR(
3838
yql/essentials/minikql
3939
yql/essentials/protos
4040
yql/essentials/ast
41+
yql/essentials/sql
4142
yql/essentials/sql/pg
43+
yql/essentials/sql/v1
4244

4345
library/cpp/getopt
4446
library/cpp/logger

yql/tools/yqlrun/yqlrun.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include <yql/essentials/core/yql_udf_index.h>
2424
#include <yql/essentials/core/yql_library_compiler.h>
2525
#include <yql/essentials/ast/yql_expr.h>
26+
#include <yql/essentials/sql/sql.h>
27+
#include <yql/essentials/sql/v1/sql.h>
2628

2729
#include <library/cpp/getopt/last_getopt.h>
2830
#include <library/cpp/logger/stream.h>
@@ -207,6 +209,12 @@ int RunUI(int argc, const char* argv[])
207209

208210
CommonInit(res, udfResolverPath, udfResolverFilterSyscalls, udfsPaths, fileStorage, udfResolver, funcRegistry, udfIndex);
209211

212+
NSQLTranslation::TTranslators translators(
213+
nullptr,
214+
NSQLTranslationV1::MakeTranslator(),
215+
NSQLTranslationPG::MakeTranslator()
216+
);
217+
210218
TExprContext ctx;
211219
ctx.NextUniqueId = NPg::GetSqlLanguageParser()->GetContext().NextUniqueId;
212220
IModuleResolver::TPtr moduleResolver;
@@ -216,13 +224,13 @@ int RunUI(int argc, const char* argv[])
216224
Y_ABORT_UNLESS(mount);
217225
FillUserDataTableFromFileSystem(*mount, userData);
218226

219-
if (!CompileLibraries(userData, ctx, modules)) {
227+
if (!CompileLibraries(translators, userData, ctx, modules)) {
220228
Cerr << "Errors on compile libraries:" << Endl;
221229
ctx.IssueManager.GetIssues().PrintTo(Cerr);
222230
return -1;
223231
}
224232

225-
moduleResolver = std::make_shared<TModuleResolver>(std::move(modules), ctx.NextUniqueId, clusterMapping, sqlFlags);
233+
moduleResolver = std::make_shared<TModuleResolver>(translators, std::move(modules), ctx.NextUniqueId, clusterMapping, sqlFlags);
226234
} else {
227235
if (!GetYqlDefaultModuleResolver(ctx, moduleResolver, clusterMapping)) {
228236
Cerr << "Errors loading default YQL libraries:" << Endl;

0 commit comments

Comments
 (0)