diff options
Diffstat (limited to 'ydb/library/yql/minikql/mkql_node_serialization.cpp')
-rw-r--r-- | ydb/library/yql/minikql/mkql_node_serialization.cpp | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/ydb/library/yql/minikql/mkql_node_serialization.cpp b/ydb/library/yql/minikql/mkql_node_serialization.cpp index e314f38cd6..4ebe5ba9f3 100644 --- a/ydb/library/yql/minikql/mkql_node_serialization.cpp +++ b/ydb/library/yql/minikql/mkql_node_serialization.cpp @@ -154,6 +154,18 @@ namespace { IsProcessed0 = false; } + void Visit(TPgType& node) override { + if (node.GetCookie() != 0) { + Owner.WriteReference(node); + IsProcessed0 = true; + return; + } + + Owner.Write(TypeMarker | (char)TType::EKind::Pg); + Owner.WriteVar32(node.GetTypeId()); + IsProcessed0 = false; + } + void Visit(TStructType& node) override { if (node.GetCookie() != 0) { Owner.WriteReference(node); @@ -575,6 +587,10 @@ namespace { Owner.RegisterReference(node); } + void Visit(TPgType& node) override { + Owner.RegisterReference(node); + } + void Visit(TStructType& node) override { for (ui32 i = 0, e = node.GetMembersCount(); i < e; ++i) { auto memberName = node.GetMemberNameStr(i); @@ -1174,7 +1190,7 @@ namespace { case TType::EKind::Void: return ReadVoidOrEmptyListOrEmptyDictType(code); case TType::EKind::Data: - return ReadDataType(); + return ReadDataOrPgType(code); case TType::EKind::Struct: return ReadStructType(); case TType::EKind::List: @@ -1236,6 +1252,12 @@ namespace { return Nodes.back(); } + TNode* ReadPgType() { + const auto typeId = ReadVar32(); + Nodes.emplace_back(TPgType::Create(typeId, Env)); + return Nodes.back(); + } + ui32 TryReadKeyType(char code) { const bool isRoot = (code & UserMarker1) != 0; const bool hasStaticValue = (code & UserMarker2) != 0; @@ -1385,6 +1407,15 @@ namespace { } } + TNode* ReadDataOrPgType(char code) { + switch ((TType::EKind)(code & TypeMask)) { + case TType::EKind::Data: return ReadDataType(); + case TType::EKind::Pg: return ReadPgType(); + default: + ThrowCorrupted(); + } + } + TNode* ReadDictType() { auto keyTypeNode = PopNode(); if (keyTypeNode->GetType()->GetKind() != TType::EKind::Type) |