diff options
| author | aneporada <[email protected]> | 2022-12-20 18:13:56 +0300 |
|---|---|---|
| committer | aneporada <[email protected]> | 2022-12-20 18:13:56 +0300 |
| commit | f37198778abfc9966a20b45117657a92c31d0e17 (patch) | |
| tree | 717d17623fc3119dea8172f4652c3bd83ad040c5 /ydb/library/yql/ast/yql_expr.h | |
| parent | 1e90d439ad65bba680872176ad4ad3b3f87224d1 (diff) | |
Initial support for strings in blocks: BlockReader/BlockBuilder
Diffstat (limited to 'ydb/library/yql/ast/yql_expr.h')
| -rw-r--r-- | ydb/library/yql/ast/yql_expr.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/ydb/library/yql/ast/yql_expr.h b/ydb/library/yql/ast/yql_expr.h index 7ec95914503..6c77bbb30f9 100644 --- a/ydb/library/yql/ast/yql_expr.h +++ b/ydb/library/yql/ast/yql_expr.h @@ -132,7 +132,8 @@ enum ETypeAnnotationFlags : ui32 { TypeHasManyValues = 0x200, TypeHasBareYson = 0x400, TypeHasNestedOptional = 0x800, - TypeNonPresortable = 0x1000 + TypeNonPresortable = 0x1000, + TypeHasDynamicSize = 0x2000, }; const ui64 TypeHashMagic = 0x10000; @@ -235,6 +236,15 @@ public: return kind == ETypeAnnotationKind::Optional || kind == ETypeAnnotationKind::Null || kind == ETypeAnnotationKind::Pg; } + bool IsAnyBlockOrScalar() const { + auto kind = GetKind(); + return kind == ETypeAnnotationKind::Block || kind == ETypeAnnotationKind::ChunkedBlock || kind == ETypeAnnotationKind::Scalar; + } + + bool HasFixedSizeRepr() const { + return (GetFlags() & (TypeHasDynamicSize | TypeNonPersistable | TypeNonComputable)) == 0; + } + bool IsSingleton() const { return (GetFlags() & TypeHasManyValues) == 0; } @@ -551,7 +561,7 @@ public: static constexpr ETypeAnnotationKind KindValue = ETypeAnnotationKind::List; TListExprType(ui64 hash, const TTypeAnnotationNode* itemType) - : TTypeAnnotationNode(KindValue, itemType->GetFlags(), hash) + : TTypeAnnotationNode(KindValue, itemType->GetFlags() | TypeHasDynamicSize, hash) , ItemType(itemType) { } @@ -737,6 +747,10 @@ public: ret |= TypeHasBareYson; } + if (props & NUdf::StringType) { + ret |= TypeHasDynamicSize; + } + return ret; } @@ -801,6 +815,7 @@ class TPgExprType : public TTypeAnnotationNode { public: static constexpr ETypeAnnotationKind KindValue = ETypeAnnotationKind::Pg; + // TODO: TypeHasDynamicSize for Pg types TPgExprType(ui64 hash, ui32 typeId) : TTypeAnnotationNode(KindValue, GetFlags(typeId), hash) , TypeId(typeId) @@ -953,7 +968,8 @@ public: static constexpr ETypeAnnotationKind KindValue = ETypeAnnotationKind::Dict; TDictExprType(ui64 hash, const TTypeAnnotationNode* keyType, const TTypeAnnotationNode* payloadType) - : TTypeAnnotationNode(KindValue, TypeNonComparable | keyType->GetFlags() | payloadType->GetFlags(), hash) + : TTypeAnnotationNode(KindValue, TypeNonComparable | TypeHasDynamicSize | + keyType->GetFlags() | payloadType->GetFlags(), hash) , KeyType(keyType) , PayloadType(payloadType) { |
