diff options
author | udovichenko-r <rvu@ydb.tech> | 2023-08-18 13:02:31 +0300 |
---|---|---|
committer | udovichenko-r <rvu@ydb.tech> | 2023-08-18 16:53:03 +0300 |
commit | 9492e756dbf11036f86e5bbd05c0d196aadf2118 (patch) | |
tree | 9d89ede6dcb751771b6530e18d859c61bb42ada3 | |
parent | 5e2132416de6bd7cfdb2e359f1d8e1daa7290380 (diff) | |
download | ydb-9492e756dbf11036f86e5bbd05c0d196aadf2118.tar.gz |
[yt provider] Don't cut path prefix before canonize_path
YQL-16323
-rw-r--r-- | ydb/library/yql/providers/yt/gateway/native/yql_yt_native.cpp | 17 |
1 files changed, 12 insertions, 5 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 67b4a04d86..021a3e9033 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 @@ -310,8 +310,12 @@ public: if (r.TableIndicies.empty()) { r.ExecContext = MakeExecCtx(TCanonizePathsOptions(options), session, cluster, nullptr, nullptr); } - TString tmpFolder = GetTablesTmpFolder(*options.Config()); - path.Path(NYql::TransformPath(tmpFolder, path.Path(), false, session->UserName_)); + + // Use absolute path to prevent adding YT_PREFFIX + if (!path.Path().StartsWith("//") && !path.Path().StartsWith("<")) { + path.Path(TString("//").append(path.Path())); + } + r.TableIndicies.push_back(i); } @@ -1305,8 +1309,11 @@ private: batchRes.push_back(batch->CanonizeYPath(canonReq.Path()).Apply([idx, &res] (const TFuture<TRichYPath>& f) { auto& normalizedPath = f.GetValue(); TString path = normalizedPath.Path_; - if (path.StartsWith(TConfig::Get()->Prefix)) { - path = path.substr(TConfig::Get()->Prefix.size()); + + // Convert back from absolute path to relative + // All futhrer YT operations will use the path with YT_PREFIX + if (path.StartsWith("//")) { + path = path.substr(2); } res.Data[idx].Path = path; if (normalizedPath.Columns_) { @@ -4807,4 +4814,4 @@ IYtGateway::TPtr CreateYtNativeGateway(const TYtNativeServices& services) { return MakeIntrusive<NNative::TYtNativeGateway>(services); } -} // NYql
\ No newline at end of file +} // NYql |