diff options
author | Andrey Zaspa <zaspa94@ydb.tech> | 2025-05-30 12:34:53 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-30 12:34:53 +0400 |
commit | cde1dc253a0f9d5f7f11bfe9adb826e4748adf1c (patch) | |
tree | 02f778b3078b5f417e61425506c59405197f0fe0 | |
parent | 8da33cb921a2fca572706e406a4ec023e0c864cb (diff) | |
download | ydb-cde1dc253a0f9d5f7f11bfe9adb826e4748adf1c.tar.gz |
Added processing sys view path type in GRPC handlers (#19030)
-rw-r--r-- | ydb/core/grpc_services/rpc_kh_describe.cpp | 2 | ||||
-rw-r--r-- | ydb/core/grpc_services/rpc_read_columns.cpp | 4 | ||||
-rw-r--r-- | ydb/core/grpc_services/rpc_read_rows.cpp | 4 | ||||
-rw-r--r-- | ydb/public/api/protos/ydb_scheme.proto | 1 |
4 files changed, 6 insertions, 5 deletions
diff --git a/ydb/core/grpc_services/rpc_kh_describe.cpp b/ydb/core/grpc_services/rpc_kh_describe.cpp index 0fcb9408cd8..2d9bcf69723 100644 --- a/ydb/core/grpc_services/rpc_kh_describe.cpp +++ b/ydb/core/grpc_services/rpc_kh_describe.cpp @@ -228,7 +228,7 @@ private: void ResolveShards(const NActors::TActorContext& ctx) { auto& entry = ResolveNamesResult->ResultSet.front(); - if (entry.TableId.IsSystemView()) { + if (entry.TableId.IsSystemView() || entry.Kind == NSchemeCache::TSchemeCacheNavigate::KindSysView) { // Add fake shard for sys view auto* p = Result.add_partitions(); p->set_tablet_id(1); diff --git a/ydb/core/grpc_services/rpc_read_columns.cpp b/ydb/core/grpc_services/rpc_read_columns.cpp index 93857b55ed0..45a81807dc7 100644 --- a/ydb/core/grpc_services/rpc_read_columns.cpp +++ b/ydb/core/grpc_services/rpc_read_columns.cpp @@ -230,9 +230,9 @@ private: ctx); } - if (ResolveNamesResult->ResultSet.front().TableId.IsSystemView()) { + if (entry.TableId.IsSystemView() || entry.Kind == NSchemeCache::TSchemeCacheNavigate::KindSysView) { return ScanSystemView(ctx); - } if (TryParseLocalDbPath(ResolveNamesResult->ResultSet.front().Path)) { + } if (TryParseLocalDbPath(entry.Path)) { return ScanLocalDbTable(ctx); } else { return ResolveShards(ctx); diff --git a/ydb/core/grpc_services/rpc_read_rows.cpp b/ydb/core/grpc_services/rpc_read_rows.cpp index 01a80c99223..e8d8db48609 100644 --- a/ydb/core/grpc_services/rpc_read_rows.cpp +++ b/ydb/core/grpc_services/rpc_read_rows.cpp @@ -385,7 +385,7 @@ public: OwnerId = entry.Self->Info.GetSchemeshardId(); TableId = entry.Self->Info.GetPathId(); - if (entry.TableId.IsSystemView()) { + if (entry.TableId.IsSystemView() || entry.Kind == NSchemeCache::TSchemeCacheNavigate::KindSysView) { return ReplyWithError(Ydb::StatusIds::SCHEME_ERROR, Sprintf("Table '%s' is a system view. ReadRows is not supported.", GetTable().c_str())); } @@ -592,7 +592,7 @@ public: } case NScheme::NTypeIds::Decimal: { return NYdb::TTypeBuilder().Decimal(NYdb::TDecimalType( - typeInfo.GetDecimalType().GetPrecision(), + typeInfo.GetDecimalType().GetPrecision(), typeInfo.GetDecimalType().GetScale())) .Build(); } diff --git a/ydb/public/api/protos/ydb_scheme.proto b/ydb/public/api/protos/ydb_scheme.proto index 08d74ecae01..9d25f709ec0 100644 --- a/ydb/public/api/protos/ydb_scheme.proto +++ b/ydb/public/api/protos/ydb_scheme.proto @@ -67,6 +67,7 @@ message Entry { VIEW = 20; RESOURCE_POOL = 21; TRANSFER = 23; + SYS_VIEW = 24; } // Name of scheme entry (dir2 of /dir1/dir2) |