aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbabenko <babenko@yandex-team.com>2024-10-16 00:31:56 +0300
committerbabenko <babenko@yandex-team.com>2024-10-16 00:43:20 +0300
commit7df51c087e50f0756e3c51c7dcbf10392f441d12 (patch)
tree9f827bd7b57edb6b8fca116c422583bfe599b66a
parent4e55354ca040f2770a2c41be59e1187ef9a0da90 (diff)
downloadydb-7df51c087e50f0756e3c51c7dcbf10392f441d12.tar.gz
Properly format object types
commit_hash:de54d92d32ae4139b5f630d25bfb265f343c9c1c
-rw-r--r--yt/yt/client/object_client/helpers.cpp5
-rw-r--r--yt/yt/client/object_client/helpers.h3
2 files changed, 8 insertions, 0 deletions
diff --git a/yt/yt/client/object_client/helpers.cpp b/yt/yt/client/object_client/helpers.cpp
index c4d02fa6d0..795c0fb34c 100644
--- a/yt/yt/client/object_client/helpers.cpp
+++ b/yt/yt/client/object_client/helpers.cpp
@@ -330,6 +330,11 @@ bool IsSchemaType(EObjectType type)
return (static_cast<ui32>(type) & SchemaObjectTypeMask) != 0;
}
+TString FormatObjectType(EObjectType type)
+{
+ return IsSchemaType(type) ? Format("schema:%v", TypeFromSchemaType(type)) : FormatEnum(type);
+}
+
bool IsGlobalCellId(TCellId cellId)
{
auto type = TypeFromId(cellId);
diff --git a/yt/yt/client/object_client/helpers.h b/yt/yt/client/object_client/helpers.h
index 3139e5481b..1c668033c9 100644
--- a/yt/yt/client/object_client/helpers.h
+++ b/yt/yt/client/object_client/helpers.h
@@ -119,6 +119,9 @@ EObjectType SchemaTypeFromType(EObjectType type);
//! Returns the regular type for a given schema #type.
EObjectType TypeFromSchemaType(EObjectType type);
+//! Formats object type into string (taking schemas into account).
+TString FormatObjectType(EObjectType type);
+
//! Constructs the id from its parts.
TObjectId MakeId(
EObjectType type,