aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfedor-miron <fedor-miron@yandex-team.com>2023-09-05 16:40:47 +0300
committerfedor-miron <fedor-miron@yandex-team.com>2023-09-05 18:11:33 +0300
commitd8c76f14d96ee55615360f8d19d6ff8da243be4f (patch)
tree49a8df0abcc4dfcf6c61011f0e5d4c109dc354a1
parentad6ab7f24891543e0729e88860a31ae95d11c468 (diff)
downloadydb-d8c76f14d96ee55615360f8d19d6ff8da243be4f.tar.gz
YQL-16444: fix empty prefix for yt batch list in io discovery
-rw-r--r--ydb/library/yql/providers/yt/gateway/native/yql_yt_native.cpp8
-rw-r--r--ydb/library/yql/providers/yt/gateway/native/yql_yt_native_folders.cpp6
-rw-r--r--ydb/library/yql/providers/yt/provider/yql_yt_io_discovery.cpp2
3 files changed, 15 insertions, 1 deletions
diff --git a/ydb/library/yql/providers/yt/gateway/native/yql_yt_native.cpp b/ydb/library/yql/providers/yt/gateway/native/yql_yt_native.cpp
index 7b7870f789..eb0d37b61c 100644
--- a/ydb/library/yql/providers/yt/gateway/native/yql_yt_native.cpp
+++ b/ydb/library/yql/providers/yt/gateway/native/yql_yt_native.cpp
@@ -487,7 +487,13 @@ public:
auto resolvedLinksFuture = getFolderFuture.Apply([options, this, session] (const TFuture<TBatchFolderResult>& f) {
TVector<IYtGateway::TResolveOptions::TItemWithReqAttrs> resolveItems;
auto res = f.GetValue();
+ if (res.Items.empty()) {
+ YQL_CLOG(INFO, ProviderYt) << "Skipping resolve for empty batch folder result";
+ return res;
+ }
+
for (auto&& item : res.Items) {
+ YQL_CLOG(DEBUG, ProviderYt) << "Adding to batch get command: " << item.Path;
IYtGateway::TResolveOptions::TItemWithReqAttrs resolveItem {
.Item = item,
.AttrKeys = options.Attributes()
@@ -512,6 +518,8 @@ public:
res.SetSuccess();
auto resolveRes = f.GetValue();
+ YQL_CLOG(INFO, ProviderYt) << "Batch get command got: " << resolveRes.Items.size() << " items";
+
TVector<TFolderResult::TFolderItem> items;
for (auto& batchItem : resolveRes.Items) {
TFolderResult::TFolderItem item {
diff --git a/ydb/library/yql/providers/yt/gateway/native/yql_yt_native_folders.cpp b/ydb/library/yql/providers/yt/gateway/native/yql_yt_native_folders.cpp
index f668633115..1fdc86f8ef 100644
--- a/ydb/library/yql/providers/yt/gateway/native/yql_yt_native_folders.cpp
+++ b/ydb/library/yql/providers/yt/gateway/native/yql_yt_native_folders.cpp
@@ -166,6 +166,7 @@ IYtGateway::TBatchFolderResult ExecGetFolder(const TExecContext<IYtGateway::TBat
folderResult.SetSuccess();
for (const auto& folder : execCtx->Options_.Folders()) {
+ YQL_CLOG(INFO, ProviderYt) << "Executing list command with prefix: " << folder.Prefix;
const auto cacheKey = std::accumulate(folder.AttrKeys.begin(), folder.AttrKeys.end(), folder.Prefix,
[] (TString&& str, const TString& arg) {
return str + "&" + arg;
@@ -188,7 +189,10 @@ IYtGateway::TBatchFolderResult ExecGetFolder(const TExecContext<IYtGateway::TBat
folderItems.reserve(nodeList.size());
for (const auto& node : nodeList) {
TStringBuilder path;
- path << folder.Prefix << "/" << node.AsString();
+ if (!folder.Prefix.Empty()) {
+ path << folder.Prefix << "/";
+ }
+ path << node.AsString();
folderItems.push_back(MakeFolderItem(node, path));
}
StoreResInCache(entry, std::move(folderItems), cacheKey);
diff --git a/ydb/library/yql/providers/yt/provider/yql_yt_io_discovery.cpp b/ydb/library/yql/providers/yt/provider/yql_yt_io_discovery.cpp
index 08ce8f059e..a8d5625cfa 100644
--- a/ydb/library/yql/providers/yt/provider/yql_yt_io_discovery.cpp
+++ b/ydb/library/yql/providers/yt/provider/yql_yt_io_discovery.cpp
@@ -16,6 +16,7 @@
#include <ydb/library/yql/core/peephole_opt/yql_opt_peephole_physical.h>
#include <ydb/library/yql/core/issue/protos/issue_id.pb.h>
#include <ydb/library/yql/core/issue/yql_issue.h>
+#include <ydb/library/yql/utils/log/log.h>
#include <library/cpp/yson/node/node_io.h>
#include <library/cpp/threading/future/future.h>
@@ -411,6 +412,7 @@ public:
}
auto items = std::get<TVector<IYtGateway::TFolderResult::TFolderItem>>(res->ItemsOrFileLink);
+ YQL_CLOG(INFO, ProviderYt) << "Got " << items.size() << " items for " << " GetFolder";
TVector<TExprBase> listItems;
for (auto& item: items) {
listItems.push_back(BuildFolderListItemExpr(ctx, node->Pos(), item));