From f1437baa69bc7991c9a5ce461ea03ff10e88a97b Mon Sep 17 00:00:00 2001 From: MrLolthe1st Date: Wed, 17 Jan 2024 14:31:10 +0000 Subject: [PATCH] Add block reader over file --- .../gateway/file/yql_yt_file_mkql_compiler.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ydb/library/yql/providers/yt/gateway/file/yql_yt_file_mkql_compiler.cpp b/ydb/library/yql/providers/yt/gateway/file/yql_yt_file_mkql_compiler.cpp index 1040ff5d22cb..a6aa9bc70f66 100644 --- a/ydb/library/yql/providers/yt/gateway/file/yql_yt_file_mkql_compiler.cpp +++ b/ydb/library/yql/providers/yt/gateway/file/yql_yt_file_mkql_compiler.cpp @@ -1057,6 +1057,24 @@ void RegisterDqYtFileMkqlCompilers(NCommon::TMkqlCallableCompilerBase& compiler) return TRuntimeNode(); }); + compiler.OverrideCallable(TDqReadBlockWideWrap::CallableName(), + [](const TExprNode& node, NCommon::TMkqlBuildContext& ctx) { + const auto wrapper = TDqReadWrapBase(&node); + if (wrapper.Input().Maybe().IsValid()) { + auto ytRead = wrapper.Input().Cast(); + auto cluster = TString{ytRead.DataSource().Cluster().Value()}; + const auto outputType = NCommon::BuildType(wrapper.Ref(), + *ytRead.Input().Ref().GetTypeAnn()->Cast()->GetItems()[0]->Cast()->GetItemType(), ctx.ProgramBuilder); + + auto values = BuildTableContentCall("YtTableInputFile", outputType, cluster, + ytRead.Input().Ref(), Nothing(), ctx, false, THashSet{"num", "index"}); + values = ApplyPathRangesAndSampling(values, outputType, ytRead.Input().Ref(), ctx); + return ctx.ProgramBuilder.FromFlow(ctx.ProgramBuilder.WideToBlocks(ExpandFlow(ctx.ProgramBuilder.ToFlow(values), ctx))); + } + + return TRuntimeNode(); + }); + compiler.OverrideCallable(TYtDqWideWrite::CallableName(), [](const TExprNode& node, NCommon::TMkqlBuildContext& ctx) { const auto wideWrite = TYtDqWideWrite(&node);