MCPcopy Create free account
hub / github.com/ByConity/ByConity / DataTypeArray

Class DataTypeArray

src/DataTypes/DataTypeArray.h:32–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30
31
32class DataTypeArray final : public IDataType
33{
34private:
35 /// The type of array elements.
36 DataTypePtr nested;
37
38public:
39 static constexpr bool is_parametric = true;
40
41 DataTypeArray(const DataTypePtr & nested_);
42
43 TypeIndex getTypeId() const override { return TypeIndex::Array; }
44
45 std::string doGetName() const override
46 {
47 return "Array(" + nested->getName() + ")";
48 }
49
50 const char * getFamilyName() const override
51 {
52 return "Array";
53 }
54
55 /// Map support array key
56 bool canBeInsideNullable() const override
57 {
58 return true;
59 }
60
61 MutableColumnPtr createColumn() const override;
62
63 Field getDefault() const override;
64
65 bool equals(const IDataType & rhs) const override;
66
67 bool isParametric() const override { return true; }
68 bool haveSubtypes() const override { return true; }
69 bool cannotBeStoredInTables() const override { return nested->cannotBeStoredInTables(); }
70 bool textCanContainOnlyValidUTF8() const override { return nested->textCanContainOnlyValidUTF8(); }
71 bool isComparable() const override { return nested->isComparable(); }
72 bool canBeComparedWithCollation() const override { return nested->canBeComparedWithCollation(); }
73
74 bool isValueUnambiguouslyRepresentedInContiguousMemoryRegion() const override
75 {
76 return nested->isValueUnambiguouslyRepresentedInFixedSizeContiguousMemoryRegion();
77 }
78
79 DataTypePtr tryGetSubcolumnType(const String & subcolumn_name) const override;
80 ColumnPtr getSubcolumn(const String & subcolumn_name, const IColumn & column) const override;
81 // SerializationPtr getSubcolumnSerialization(
82 // const String & subcolumn_name, const BaseSerializationGetter & base_serialization_getter) const override;
83
84 SerializationPtr doGetDefaultSerialization() const override;
85
86 const DataTypePtr & getNestedType() const { return nested; }
87
88 /// 1 for plain array, 2 for array of arrays and so on.
89 size_t getNumberOfDimensions() const;

Callers 1

createLayoutFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected