aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordcherednik <dcherednik@ydb.tech>2023-08-17 19:41:15 +0300
committerdcherednik <dcherednik@ydb.tech>2023-08-17 21:43:35 +0300
commitd6903c15831fd21acc2c9a54dc88501e8b70b5e3 (patch)
treef797943daea1acd8dc338b22b07a7f841daf0eae
parent859238ccef6b8fad5f04fde5a990513b90cbc489 (diff)
downloadydb-d6903c15831fd21acc2c9a54dc88501e8b70b5e3.tar.gz
Allow describing indexImplTable via public api
-rw-r--r--ydb/core/grpc_services/rpc_describe_table.cpp5
-rw-r--r--ydb/core/kqp/ut/indexes/kqp_indexes_ut.cpp13
2 files changed, 15 insertions, 3 deletions
diff --git a/ydb/core/grpc_services/rpc_describe_table.cpp b/ydb/core/grpc_services/rpc_describe_table.cpp
index cb499db8ed..9517aac63e 100644
--- a/ydb/core/grpc_services/rpc_describe_table.cpp
+++ b/ydb/core/grpc_services/rpc_describe_table.cpp
@@ -131,12 +131,13 @@ private:
void SendProposeRequest(const TActorContext &ctx) {
const auto req = GetProtoRequest();
+ const TString path = req->path();
std::unique_ptr<TEvTxUserProxy::TEvNavigate> navigateRequest(new TEvTxUserProxy::TEvNavigate());
SetAuthToken(navigateRequest, *Request_);
SetDatabase(navigateRequest.get(), *Request_);
NKikimrSchemeOp::TDescribePath* record = navigateRequest->Record.MutableDescribePath();
- record->SetPath(req->path());
+ record->SetPath(path);
if (req->include_shard_key_bounds()) {
record->MutableOptions()->SetReturnBoundaries(true);
}
@@ -145,7 +146,7 @@ private:
record->MutableOptions()->SetReturnPartitionStats(true);
}
- if (AppData(ctx)->AllowPrivateTableDescribeForTest) {
+ if (AppData(ctx)->AllowPrivateTableDescribeForTest || path.EndsWith("/indexImplTable")) {
record->MutableOptions()->SetShowPrivateTable(true);
}
diff --git a/ydb/core/kqp/ut/indexes/kqp_indexes_ut.cpp b/ydb/core/kqp/ut/indexes/kqp_indexes_ut.cpp
index 82c0ff8e13..0b5f577a7d 100644
--- a/ydb/core/kqp/ut/indexes/kqp_indexes_ut.cpp
+++ b/ydb/core/kqp/ut/indexes/kqp_indexes_ut.cpp
@@ -986,7 +986,18 @@ Y_UNIT_TEST_SUITE(KqpIndexes) {
{
auto result = session.DescribeTable("/Root/TestTable/Index/indexImplTable").ExtractValueSync();
- UNIT_ASSERT_VALUES_EQUAL(result.GetStatus(), NYdb::EStatus::SCHEME_ERROR);
+ UNIT_ASSERT_VALUES_EQUAL(result.GetStatus(), NYdb::EStatus::SUCCESS);
+
+ const THashMap<std::string_view, std::string_view> columnTypes = {
+ {"Key", "String?"},
+ {"Index2", "String?"}
+ };
+
+ const auto& columns = result.GetTableDescription().GetTableColumns();
+ UNIT_ASSERT_VALUES_EQUAL(columns.size(), columnTypes.size());
+ for (const auto& column : columns) {
+ UNIT_ASSERT_VALUES_EQUAL_C(column.Type.ToString(), columnTypes.at(column.Name), column.Name);
+ }
}
{