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 f0468382da0f..86d3714b61f8 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 @@ -1756,7 +1756,6 @@ class TYtNativeGateway : public IYtGateway { auto pos = execCtx->Options_.Pos(); try { auto entry = execCtx->GetOrCreateEntry(); - auto deterministicMode = execCtx->Session_->DeterministicMode_; TString prefix = execCtx->Options_.Prefix(); TString suffix = execCtx->Options_.Suffix(); @@ -1765,7 +1764,7 @@ class TYtNativeGateway : public IYtGateway { with_lock(entry->Lock_) { if (auto p = entry->RangeCache.FindPtr(cacheKey)) { YQL_CLOG(INFO, ProviderYt) << "Found range in cache for key ('" << prefix << "','" << suffix << "',) - number of items " << p->size(); - return MakeFuture(MakeTableRangeResult(*p, deterministicMode)); + return MakeFuture(MakeTableRangeResult(*p)); } } @@ -1890,7 +1889,7 @@ class TYtNativeGateway : public IYtGateway { auto logCtx = execCtx->LogCtx_; return ExecCalc(filterLambda, extraUsage, tmpTablePath, execCtx, entry, TNodeResultFactory()) - .Apply([logCtx, prefix, suffix, entry, deterministicMode, pos, errors = std::move(errors), cacheKey = std::move(cacheKey)](const TFuture& f) mutable { + .Apply([logCtx, prefix, suffix, entry, pos, errors = std::move(errors), cacheKey = std::move(cacheKey)](const TFuture& f) mutable { YQL_LOG_CTX_ROOT_SESSION_SCOPE(logCtx); std::vector names; try { @@ -1903,20 +1902,20 @@ class TYtNativeGateway : public IYtGateway { } names.push_back(n.AsList().at(0).AsString()); } - return MakeTableRangeResult(std::move(names), std::move(cacheKey), prefix, suffix, entry, deterministicMode); + return MakeTableRangeResult(std::move(names), std::move(cacheKey), prefix, suffix, entry); } catch (...) { return ResultFromCurrentException(pos); } }); } - return MakeFuture(MakeTableRangeResult(std::move(names), std::move(cacheKey), prefix, suffix, entry, deterministicMode)); + return MakeFuture(MakeTableRangeResult(std::move(names), std::move(cacheKey), prefix, suffix, entry)); } catch (...) { return MakeFuture(ResultFromCurrentException(pos)); } } - static TTableRangeResult MakeTableRangeResult(const std::vector& paths, bool deterministicMode) { + static TTableRangeResult MakeTableRangeResult(const std::vector& paths) { TTableRangeResult rangeRes; rangeRes.SetSuccess(); @@ -1929,14 +1928,14 @@ class TYtNativeGateway : public IYtGateway { canonPath.Ranges = normalizedPath.GetRanges(); rangeRes.Tables.push_back(std::move(canonPath)); } - if (deterministicMode) { - SortBy(rangeRes.Tables, [] (const TCanonizedPath& path) { return path.Path; }); - } + + SortBy(rangeRes.Tables, [] (const TCanonizedPath& path) { return path.Path; }); + return rangeRes; } static TTableRangeResult MakeTableRangeResult(std::vector&& names, std::tuple&& cacheKey, - TString prefix, TString suffix, const TTransactionCache::TEntry::TPtr& entry, bool deterministicMode) + TString prefix, TString suffix, const TTransactionCache::TEntry::TPtr& entry) { TTableRangeResult rangeRes; rangeRes.SetSuccess(); @@ -1996,9 +1995,8 @@ class TYtNativeGateway : public IYtGateway { entry->RangeCache.emplace(std::move(cacheKey), std::move(cached)); } - if (deterministicMode) { - SortBy(rangeRes.Tables, [] (const TCanonizedPath& path) { return path.Path; }); - } + SortBy(rangeRes.Tables, [] (const TCanonizedPath& path) { return path.Path; }); + return rangeRes; }