diff options
author | Vadim Averin <avevad@ydb.tech> | 2024-09-10 13:39:57 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-10 13:39:57 +0300 |
commit | 29df886f76186fe61bab88af4d877a6adc84845e (patch) | |
tree | 6200c88d6f9c1c7accc5f0d66acdd4e2c029981b | |
parent | a0855f63c323cbf24ceb56f8c3fe952a46425feb (diff) | |
download | ydb-29df886f76186fe61bab88af4d877a6adc84845e.tar.gz |
Fix empty table name error (#8907)
-rw-r--r-- | ydb/library/yql/providers/yt/provider/yql_yt_io_discovery.cpp | 9 | ||||
-rw-r--r-- | ydb/library/yql/providers/yt/provider/yql_yt_key.cpp | 4 |
2 files changed, 7 insertions, 6 deletions
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 928370c31a..8218f4cd51 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 @@ -152,8 +152,13 @@ public: .Name().Value(ToString(EYtSettingType::Anonymous)).Build() .Build() .Done(); - } else if (tableInfo.Name.StartsWith("//")) { - tableInfo.Name = tableInfo.Name.substr(2); + } else if (tableInfo.Name.StartsWith(NYT::TConfig::Get()->Prefix)) { + tableInfo.Name = tableInfo.Name.substr(NYT::TConfig::Get()->Prefix.size()); + } + + if (tableInfo.Name.empty()) { + ctx.AddError(TIssue(ctx.GetPosition(write.Pos()), "Table name must not be empty")); + return {}; } if (flush) { diff --git a/ydb/library/yql/providers/yt/provider/yql_yt_key.cpp b/ydb/library/yql/providers/yt/provider/yql_yt_key.cpp index 87a61e205d..a541b1af1d 100644 --- a/ydb/library/yql/providers/yt/provider/yql_yt_key.cpp +++ b/ydb/library/yql/providers/yt/provider/yql_yt_key.cpp @@ -142,10 +142,6 @@ bool TYtKey::Parse(const TExprNode& key, TExprContext& ctx, bool isOutput) { const TExprNode* tableName = nameNode->Child(0); - if (tableName->Content().empty()) { - ctx.AddError(TIssue(ctx.GetPosition(tableName->Pos()), "Table name must not be empty")); - return false; - } Path = tableName->Content(); } else if (nameNode->IsCallable(MrTableRangeName) || nameNode->IsCallable(MrTableRangeStrictName)) { |