Browse Source

YT-21041: Predicate in secondary indices

Immutable predicate in secondary index is implemented
0ae3607b5cd3526efa01af8a9197608a4c0e950c
sabdenovch 10 months ago
parent
commit
0a83690b30

+ 3 - 0
yt/yt/client/api/rpc_proxy/table_mount_cache.cpp

@@ -102,6 +102,9 @@ private:
                     TIndexInfo indexInfo{
                         .TableId = FromProto<NObjectClient::TObjectId>(protoIndexInfo.index_table_id()),
                         .Kind = FromProto<ESecondaryIndexKind>(protoIndexInfo.index_kind()),
+                        .Predicate = protoIndexInfo.has_predicate()
+                            ? std::make_optional(FromProto<TString>(protoIndexInfo.predicate()))
+                            : std::nullopt,
                     };
                     THROW_ERROR_EXCEPTION_UNLESS(TEnumTraits<ESecondaryIndexKind>::FindLiteralByValue(indexInfo.Kind).has_value(),
                         "Unsupported secondary index kind %Qlv (client not up-to-date)",

+ 1 - 0
yt/yt/client/tablet_client/table_mount_cache.h

@@ -65,6 +65,7 @@ struct TIndexInfo
 {
     NObjectClient::TObjectId TableId;
     ESecondaryIndexKind Kind;
+    std::optional<TString> Predicate;
 };
 
 ////////////////////////////////////////////////////////////////////////////////

+ 1 - 0
yt/yt_proto/yt/client/api/rpc_proxy/proto/api_service.proto

@@ -1361,6 +1361,7 @@ message TIndexInfo
 {
     required NYT.NProto.TGuid index_table_id = 1;
     required int32 index_kind = 2; // NTableClient::ESecondaryIndexKind
+    optional string predicate = 3;
 }
 
 message TReqGetTableMountInfo