Skip to content

Commit 466cfa4

Browse files
authored
24-3: Allow to describe index table through ydb cli (#12116)
1 parent 5591125 commit 466cfa4

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

ydb/core/grpc_services/rpc_describe_path.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,12 @@ class TBaseDescribe : public TRpcSchemeRequestActor<TDerived, TRequest> {
6565
return SendProposeRequest(ctx, this->GetProtoRequest()->path());
6666
}
6767

68-
if (entry.Kind != TSchemeCacheNavigate::EKind::KindCdcStream) {
69-
return SendProposeRequest(ctx, this->GetProtoRequest()->path());
68+
switch (entry.Kind) {
69+
case TSchemeCacheNavigate::EKind::KindCdcStream:
70+
case TSchemeCacheNavigate::EKind::KindIndex:
71+
break;
72+
default:
73+
return SendProposeRequest(ctx, this->GetProtoRequest()->path());
7074
}
7175

7276
if (!entry.Self || !entry.ListNodeEntry) {
@@ -79,10 +83,10 @@ class TBaseDescribe : public TRpcSchemeRequestActor<TDerived, TRequest> {
7983
}
8084

8185
OverrideName = entry.Self->Info.GetName();
82-
const auto& topicName = entry.ListNodeEntry->Children.at(0).Name;
86+
const auto& childName = entry.ListNodeEntry->Children.at(0).Name;
8387

8488
return SendProposeRequest(ctx,
85-
NKikimr::JoinPath(NKikimr::ChildPath(NKikimr::SplitPath(this->GetProtoRequest()->path()), topicName)));
89+
NKikimr::JoinPath(NKikimr::ChildPath(NKikimr::SplitPath(this->GetProtoRequest()->path()), childName)));
8690
}
8791

8892
void SendProposeRequest(const TActorContext& ctx, const TString& path) {

ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4131,6 +4131,7 @@ Y_UNIT_TEST_SUITE(KqpScheme) {
41314131
Y_UNIT_TEST(DescribeIndexTable) {
41324132
TKikimrRunner kikimr;
41334133
auto db = kikimr.GetTableClient();
4134+
auto scheme = NYdb::NScheme::TSchemeClient(kikimr.GetDriver(), TCommonClientSettings().Database("/Root"));
41344135
auto session = db.CreateSession().GetValueSync().GetSession();
41354136

41364137
{
@@ -4147,6 +4148,11 @@ Y_UNIT_TEST_SUITE(KqpScheme) {
41474148
auto result = session.ExecuteSchemeQuery(query).GetValueSync();
41484149
UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), EStatus::SUCCESS, result.GetIssues().ToString());
41494150
}
4151+
{
4152+
auto desc = scheme.DescribePath("/Root/table/SyncIndex").ExtractValueSync();
4153+
UNIT_ASSERT_C(desc.IsSuccess(), desc.GetIssues().ToString());
4154+
UNIT_ASSERT_VALUES_EQUAL(desc.GetEntry().Name, "SyncIndex");
4155+
}
41504156
{
41514157
auto desc = session.DescribeTable("/Root/table/SyncIndex").ExtractValueSync();
41524158
UNIT_ASSERT_C(desc.IsSuccess(), desc.GetIssues().ToString());

0 commit comments

Comments
 (0)