Kùzu C++ API
Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <string>
5#include <unordered_map>
6#include <vector>
7
8#include "api.h"
9#include "cast.h"
10#include "copy_constructors.h"
11#include "internal_id_t.h"
12#include "interval_t.h"
13
14namespace kuzu {
15namespace processor {
16class ParquetReader;
17};
18namespace common {
19
20class Serializer;
21class Deserializer;
22struct FileInfo;
23
24using sel_t = uint64_t;
25using hash_t = uint64_t;
26using page_idx_t = uint32_t;
28using page_offset_t = uint32_t;
29constexpr page_idx_t INVALID_PAGE_IDX = UINT32_MAX;
30using file_idx_t = uint32_t;
31constexpr file_idx_t INVALID_FILE_IDX = UINT32_MAX;
32using page_group_idx_t = uint32_t;
34using property_id_t = uint32_t;
35constexpr property_id_t INVALID_PROPERTY_ID = UINT32_MAX;
39using idx_t = uint32_t;
40constexpr idx_t INVALID_IDX = UINT32_MAX;
41using block_idx_t = uint64_t;
42constexpr block_idx_t INVALID_BLOCK_IDX = UINT64_MAX;
43using struct_field_idx_t = uint8_t;
46using row_idx_t = uint64_t;
47constexpr row_idx_t INVALID_ROW_IDX = UINT64_MAX;
48constexpr uint32_t UNDEFINED_CAST_COST = UINT32_MAX;
49using node_group_idx_t = uint64_t;
51using partition_idx_t = uint64_t;
53using length_t = uint64_t;
54using list_size_t = uint32_t;
55using sequence_id_t = uint64_t;
56
57using transaction_t = uint64_t;
58constexpr transaction_t INVALID_TRANSACTION = UINT64_MAX;
59using executor_id_t = uint64_t;
60using executor_info = std::unordered_map<executor_id_t, uint64_t>;
61
62// System representation for a variable-sized overflow value.
64 // the size of the overflow buffer can be calculated as:
65 // numElements * sizeof(Element) + nullMap(4 bytes alignment)
66 uint64_t numElements = 0;
67 uint8_t* value = nullptr;
68};
69
77
79 int64_t pos;
80};
81
85
89
90struct int128_t;
91struct ku_string_t;
92
93template<typename T>
94concept IntegerTypes =
95 std::is_same_v<T, int8_t> || std::is_same_v<T, int16_t> || std::is_same_v<T, int32_t> ||
96 std::is_same_v<T, int64_t> || std::is_same_v<T, uint8_t> || std::is_same_v<T, uint16_t> ||
97 std::is_same_v<T, uint32_t> || std::is_same_v<T, uint64_t> || std::is_same_v<T, int128_t>;
98
99template<typename T>
100concept NumericTypes = IntegerTypes<T> || std::floating_point<T>;
101
102template<typename T>
103concept ComparableTypes = NumericTypes<T> || std::is_same_v<T, ku_string_t> ||
104 std::is_same_v<T, interval_t> || std::is_same_v<T, bool>;
105
106template<typename T>
107concept HashablePrimitive = ((std::integral<T> && !std::is_same_v<T, bool>) ||
108 std::floating_point<T> || std::is_same_v<T, int128_t>);
109template<typename T>
110concept IndexHashable = ((std::integral<T> && !std::is_same_v<T, bool>) || std::floating_point<T> ||
111 std::is_same_v<T, int128_t> || std::is_same_v<T, ku_string_t> ||
112 std::is_same_v<T, std::string_view> || std::same_as<T, std::string>);
113
114template<typename T>
115concept HashableNonNestedTypes = (std::integral<T> || std::floating_point<T> ||
116 std::is_same_v<T, int128_t> || std::is_same_v<T, internalID_t> ||
117 std::is_same_v<T, interval_t> || std::is_same_v<T, ku_string_t>);
118
119template<typename T>
121 (std::is_same_v<T, list_entry_t> || std::is_same_v<T, struct_entry_t>);
122
123template<typename T>
125
126enum class LogicalTypeID : uint8_t {
127 ANY = 0,
128 NODE = 10,
129 REL = 11,
130 RECURSIVE_REL = 12,
131 // SERIAL is a special data type that is used to represent a sequence of INT64 values that are
132 // incremented by 1 starting from 0.
133 SERIAL = 13,
134
135 BOOL = 22,
136 INT64 = 23,
137 INT32 = 24,
138 INT16 = 25,
139 INT8 = 26,
140 UINT64 = 27,
141 UINT32 = 28,
142 UINT16 = 29,
143 UINT8 = 30,
144 INT128 = 31,
145 DOUBLE = 32,
146 FLOAT = 33,
147 DATE = 34,
148 TIMESTAMP = 35,
149 TIMESTAMP_SEC = 36,
150 TIMESTAMP_MS = 37,
151 TIMESTAMP_NS = 38,
152 TIMESTAMP_TZ = 39,
153 INTERVAL = 40,
154 DECIMAL = 41,
155 INTERNAL_ID = 42,
156
157 STRING = 50,
158 BLOB = 51,
159
160 LIST = 52,
161 ARRAY = 53,
162 STRUCT = 54,
163 MAP = 55,
164 UNION = 56,
165 RDF_VARIANT = 57,
166 POINTER = 58,
167
168 UUID = 59,
169};
170
171enum class PhysicalTypeID : uint8_t {
172 // Fixed size types.
173 ANY = 0,
174 BOOL = 1,
175 INT64 = 2,
176 INT32 = 3,
177 INT16 = 4,
178 INT8 = 5,
179 UINT64 = 6,
180 UINT32 = 7,
181 UINT16 = 8,
182 UINT8 = 9,
183 INT128 = 10,
184 DOUBLE = 11,
185 FLOAT = 12,
186 INTERVAL = 13,
187 INTERNAL_ID = 14,
188
189 // Variable size types.
190 STRING = 20,
191 LIST = 22,
192 ARRAY = 23,
193 STRUCT = 24,
194 POINTER = 25,
195};
196
197class ExtraTypeInfo;
198class StructField;
199class StructTypeInfo;
200
202 friend struct LogicalTypeUtils;
203 friend struct DecimalType;
204 friend struct StructType;
205 friend struct ListType;
206 friend struct ArrayType;
207
208 KUZU_API LogicalType(const LogicalType& other);
209
210public:
211 KUZU_API LogicalType() : typeID{LogicalTypeID::ANY}, extraTypeInfo{nullptr} {
212 physicalType = getPhysicalType(this->typeID);
213 };
216
217 KUZU_API bool operator==(const LogicalType& other) const;
218 KUZU_API bool operator!=(const LogicalType& other) const;
219
220 KUZU_API std::string toString() const;
221 static bool tryConvertFromString(const std::string& str, LogicalType& type);
222 static LogicalType fromString(const std::string& str);
223
224 KUZU_API LogicalTypeID getLogicalTypeID() const { return typeID; }
225 bool containsAny() const;
226
227 KUZU_API PhysicalTypeID getPhysicalType() const { return physicalType; }
229 const std::unique_ptr<ExtraTypeInfo>& extraTypeInfo = nullptr);
230
231 void setExtraTypeInfo(std::unique_ptr<ExtraTypeInfo> typeInfo) {
232 extraTypeInfo = std::move(typeInfo);
233 }
234
235 void serialize(Serializer& serializer) const;
236
237 static LogicalType deserialize(Deserializer& deserializer);
238
239 KUZU_API static std::vector<LogicalType> copy(const std::vector<LogicalType>& types);
240 KUZU_API static std::vector<LogicalType> copy(const std::vector<LogicalType*>& types);
241
263 static KUZU_API LogicalType DECIMAL(uint32_t precision, uint32_t scale);
270 static KUZU_API LogicalType STRUCT(std::vector<StructField>&& fields);
271
272 static KUZU_API LogicalType RECURSIVE_REL(std::unique_ptr<StructTypeInfo> typeInfo);
273
274 static KUZU_API LogicalType NODE(std::unique_ptr<StructTypeInfo> typeInfo);
275
276 static KUZU_API LogicalType REL(std::unique_ptr<StructTypeInfo> typeInfo);
277
279
280 static KUZU_API LogicalType UNION(std::vector<StructField>&& fields);
281
283 template<class T>
284 static inline LogicalType LIST(T&& childType) {
285 return LogicalType::LIST(LogicalType(std::forward<T>(childType)));
286 }
287
288 static KUZU_API LogicalType MAP(LogicalType keyType, LogicalType valueType);
289 template<class T>
290 static LogicalType MAP(T&& keyType, T&& valueType) {
291 return LogicalType::MAP(LogicalType(std::forward<T>(keyType)),
292 LogicalType(std::forward<T>(valueType)));
293 }
294
295 static KUZU_API LogicalType ARRAY(LogicalType childType, uint64_t numElements);
296 template<class T>
297 static LogicalType ARRAY(T&& childType, uint64_t numElements) {
298 return LogicalType::ARRAY(LogicalType(std::forward<T>(childType)), numElements);
299 }
300
301private:
302 friend struct CAPIHelper;
303 friend struct JavaAPIHelper;
305 explicit LogicalType(LogicalTypeID typeID, std::unique_ptr<ExtraTypeInfo> extraTypeInfo);
306
307private:
308 LogicalTypeID typeID;
309 PhysicalTypeID physicalType;
310 std::unique_ptr<ExtraTypeInfo> extraTypeInfo;
311};
312
314public:
315 virtual ~ExtraTypeInfo() = default;
316
317 void serialize(Serializer& serializer) const { serializeInternal(serializer); }
318
319 virtual bool containsAny() const = 0;
320
321 virtual bool operator==(const ExtraTypeInfo& other) const = 0;
322
323 virtual std::unique_ptr<ExtraTypeInfo> copy() const = 0;
324
325 template<class TARGET>
326 const TARGET* constPtrCast() const {
328 }
329
330protected:
331 virtual void serializeInternal(Serializer& serializer) const = 0;
332};
333
334class DecimalTypeInfo final : public ExtraTypeInfo {
335public:
336 explicit DecimalTypeInfo(uint32_t precision = 18, uint32_t scale = 3)
338
339 uint32_t getPrecision() const { return precision; }
340 uint32_t getScale() const { return scale; }
341
342 bool containsAny() const override { return false; }
343
344 bool operator==(const ExtraTypeInfo& other) const override;
345
346 std::unique_ptr<ExtraTypeInfo> copy() const override;
347
348 static std::unique_ptr<ExtraTypeInfo> deserialize(Deserializer& deserializer);
349
350protected:
351 void serializeInternal(Serializer& serializer) const override;
352
353 uint32_t precision, scale;
354};
355
357public:
358 ListTypeInfo() = default;
360
361 const LogicalType& getChildType() const { return childType; }
362
363 bool containsAny() const override;
364
365 bool operator==(const ExtraTypeInfo& other) const override;
366
367 std::unique_ptr<ExtraTypeInfo> copy() const override;
368
369 static std::unique_ptr<ExtraTypeInfo> deserialize(Deserializer& deserializer);
370
371protected:
372 void serializeInternal(Serializer& serializer) const override;
373
374protected:
376};
377
378class ArrayTypeInfo final : public ListTypeInfo {
379public:
380 ArrayTypeInfo() = default;
381 explicit ArrayTypeInfo(LogicalType childType, uint64_t numElements)
382 : ListTypeInfo{std::move(childType)}, numElements{numElements} {}
383
384 uint64_t getNumElements() const { return numElements; }
385
386 bool operator==(const ExtraTypeInfo& other) const override;
387
388 static std::unique_ptr<ExtraTypeInfo> deserialize(Deserializer& deserializer);
389
390 std::unique_ptr<ExtraTypeInfo> copy() const override;
391
392private:
393 void serializeInternal(Serializer& serializer) const override;
394
395private:
396 uint64_t numElements;
397};
398
400public:
402 StructField(std::string name, LogicalType type)
403 : name{std::move(name)}, type{std::move(type)} {};
404
405 std::string getName() const { return name; }
406
407 const LogicalType& getType() const { return type; }
408
409 bool containsAny() const;
410
411 bool operator==(const StructField& other) const;
412 bool operator!=(const StructField& other) const { return !(*this == other); }
413
414 void serialize(Serializer& serializer) const;
415
416 static StructField deserialize(Deserializer& deserializer);
417
419
420private:
421 std::string name;
422 LogicalType type;
423};
424
425class StructTypeInfo final : public ExtraTypeInfo {
426public:
427 StructTypeInfo() = default;
428 explicit StructTypeInfo(std::vector<StructField>&& fields);
429 StructTypeInfo(const std::vector<std::string>& fieldNames,
430 const std::vector<LogicalType>& fieldTypes);
431
432 bool hasField(const std::string& fieldName) const;
433 struct_field_idx_t getStructFieldIdx(std::string fieldName) const;
435 const StructField& getStructField(const std::string& fieldName) const;
436 const std::vector<StructField>& getStructFields() const;
437
439 std::vector<const LogicalType*> getChildrenTypes() const;
440 // can't be a vector of refs since that can't be for-each looped through
441 std::vector<std::string> getChildrenNames() const;
442
443 bool containsAny() const override;
444
445 bool operator==(const ExtraTypeInfo& other) const override;
446
447 static std::unique_ptr<ExtraTypeInfo> deserialize(Deserializer& deserializer);
448 std::unique_ptr<ExtraTypeInfo> copy() const override;
449
450private:
451 void serializeInternal(Serializer& serializer) const override;
452
453private:
454 std::vector<StructField> fields;
455 std::unordered_map<std::string, struct_field_idx_t> fieldNameToIdxMap;
456};
457
458using logical_type_vec_t = std::vector<LogicalType>;
459
461 static uint32_t getPrecision(const LogicalType& type);
462 static uint32_t getScale(const LogicalType& type);
463 static std::string insertDecimalPoint(const std::string& value, uint32_t posFromEnd);
464};
465
467 static const LogicalType& getChildType(const LogicalType& type);
468};
469
471 static const LogicalType& getChildType(const LogicalType& type);
472 static uint64_t getNumElements(const LogicalType& type);
473};
474
476 static std::vector<const LogicalType*> getFieldTypes(const LogicalType& type);
477 // since the field types isn't stored as a vector of LogicalTypes, we can't return vector<>&
478
480
481 static const LogicalType& getFieldType(const LogicalType& type, const std::string& key);
482
483 static std::vector<std::string> getFieldNames(const LogicalType& type);
484
485 static uint64_t getNumFields(const LogicalType& type);
486
487 static const std::vector<StructField>& getFields(const LogicalType& type);
488
489 static bool hasField(const LogicalType& type, const std::string& key);
490
491 static const StructField& getField(const LogicalType& type, struct_field_idx_t idx);
492
493 static const StructField& getField(const LogicalType& type, const std::string& key);
494
495 static struct_field_idx_t getFieldIdx(const LogicalType& type, const std::string& key);
496};
497
499 static const LogicalType& getKeyType(const LogicalType& type);
500
501 static const LogicalType& getValueType(const LogicalType& type);
502};
503
505 static constexpr union_field_idx_t TAG_FIELD_IDX = 0;
506
507 static constexpr auto TAG_FIELD_TYPE = LogicalTypeID::INT8;
508
509 static constexpr char TAG_FIELD_NAME[] = "tag";
510
512
513 static std::string getFieldName(const LogicalType& type, union_field_idx_t idx);
514
515 static const LogicalType& getFieldType(const LogicalType& type, union_field_idx_t idx);
516
517 static uint64_t getNumFields(const LogicalType& type);
518};
519
521 static std::string toString(PhysicalTypeID physicalType);
522 static uint32_t getFixedTypeSize(PhysicalTypeID physicalType);
523};
524
526 static std::string toString(LogicalTypeID dataTypeID);
527 static std::string toString(const std::vector<LogicalType>& dataTypes);
528 static std::string toString(const std::vector<LogicalTypeID>& dataTypeIDs);
529 static uint32_t getRowLayoutSize(const LogicalType& logicalType);
530 static bool isDate(const LogicalType& dataType);
531 static bool isDate(const LogicalTypeID& dataType);
532 static bool isTimestamp(const LogicalType& dataType);
533 static bool isTimestamp(const LogicalTypeID& dataType);
534 static bool isUnsigned(const LogicalType& dataType);
535 static bool isUnsigned(const LogicalTypeID& dataType);
536 static bool isIntegral(const LogicalType& dataType);
537 static bool isIntegral(const LogicalTypeID& dataType);
538 static bool isNumerical(const LogicalType& dataType);
539 static bool isNumerical(const LogicalTypeID& dataType);
540 static bool isNested(const LogicalType& dataType);
541 static bool isNested(LogicalTypeID logicalTypeID);
542 static std::vector<LogicalTypeID> getAllValidComparableLogicalTypes();
543 static std::vector<LogicalTypeID> getNumericalLogicalTypeIDs();
544 static std::vector<LogicalTypeID> getIntegerTypeIDs();
545 static std::vector<LogicalTypeID> getAllValidLogicTypeIDs();
546 static std::vector<LogicalType> getAllValidLogicTypes();
547 static bool tryGetMaxLogicalType(const LogicalType& left, const LogicalType& right,
548 LogicalType& result);
549 static bool tryGetMaxLogicalType(const std::vector<LogicalType>& types, LogicalType& result);
550
551private:
552 static bool tryGetMaxLogicalTypeID(const LogicalTypeID& left, const LogicalTypeID& right,
553 LogicalTypeID& result);
554};
555
556enum class FileVersionType : uint8_t { ORIGINAL = 0, WAL_VERSION = 1 };
557
558} // namespace common
559} // namespace kuzu
#define KUZU_API
Definition api.h:25
Definition types.h:378
uint64_t getNumElements() const
Definition types.h:384
ArrayTypeInfo(LogicalType childType, uint64_t numElements)
Definition types.h:381
static std::unique_ptr< ExtraTypeInfo > deserialize(Deserializer &deserializer)
bool operator==(const ExtraTypeInfo &other) const override
std::unique_ptr< ExtraTypeInfo > copy() const override
Definition types.h:334
uint32_t scale
Definition types.h:353
uint32_t getScale() const
Definition types.h:340
uint32_t precision
Definition types.h:353
bool containsAny() const override
Definition types.h:342
DecimalTypeInfo(uint32_t precision=18, uint32_t scale=3)
Definition types.h:336
void serializeInternal(Serializer &serializer) const override
static std::unique_ptr< ExtraTypeInfo > deserialize(Deserializer &deserializer)
uint32_t getPrecision() const
Definition types.h:339
std::unique_ptr< ExtraTypeInfo > copy() const override
bool operator==(const ExtraTypeInfo &other) const override
Definition deserializer.h:15
Definition types.h:313
virtual std::unique_ptr< ExtraTypeInfo > copy() const =0
const TARGET * constPtrCast() const
Definition types.h:326
virtual bool operator==(const ExtraTypeInfo &other) const =0
virtual ~ExtraTypeInfo()=default
virtual bool containsAny() const =0
virtual void serializeInternal(Serializer &serializer) const =0
void serialize(Serializer &serializer) const
Definition types.h:317
Definition types.h:356
const LogicalType & getChildType() const
Definition types.h:361
bool operator==(const ExtraTypeInfo &other) const override
static std::unique_ptr< ExtraTypeInfo > deserialize(Deserializer &deserializer)
void serializeInternal(Serializer &serializer) const override
bool containsAny() const override
ListTypeInfo(LogicalType childType)
Definition types.h:359
std::unique_ptr< ExtraTypeInfo > copy() const override
LogicalType childType
Definition types.h:375
Definition types.h:201
static LogicalType INT8()
Definition types.h:248
static LogicalType BOOL()
Definition types.h:243
KUZU_API std::string toString() const
friend class kuzu::processor::ParquetReader
Definition types.h:304
static LogicalType UUID()
Definition types.h:268
static LogicalType deserialize(Deserializer &deserializer)
KUZU_API LogicalType()
Definition types.h:211
static LogicalType UINT32()
Definition types.h:250
void setExtraTypeInfo(std::unique_ptr< ExtraTypeInfo > typeInfo)
Definition types.h:231
static LogicalType TIMESTAMP_SEC()
Definition types.h:259
static LogicalType INT32()
Definition types.h:246
static KUZU_API std::vector< LogicalType > copy(const std::vector< LogicalType * > &types)
static LogicalType INT128()
Definition types.h:253
static LogicalType FLOAT()
Definition types.h:255
static KUZU_API LogicalType UNION(std::vector< StructField > &&fields)
void serialize(Serializer &serializer) const
static LogicalType HASH()
Definition types.h:244
static LogicalType INT16()
Definition types.h:247
static LogicalType INTERVAL()
Definition types.h:262
static KUZU_API LogicalType LIST(LogicalType childType)
static LogicalType INT64()
Definition types.h:245
static KUZU_API LogicalType ARRAY(LogicalType childType, uint64_t numElements)
KUZU_API bool operator==(const LogicalType &other) const
static KUZU_API LogicalType DECIMAL(uint32_t precision, uint32_t scale)
static LogicalType LIST(T &&childType)
Definition types.h:284
static LogicalType INTERNAL_ID()
Definition types.h:264
static LogicalType DOUBLE()
Definition types.h:254
static LogicalType fromString(const std::string &str)
static LogicalType TIMESTAMP_NS()
Definition types.h:257
static LogicalType DATE()
Definition types.h:256
static KUZU_API LogicalType RECURSIVE_REL(std::unique_ptr< StructTypeInfo > typeInfo)
EXPLICIT_COPY_DEFAULT_MOVE(LogicalType)
KUZU_API LogicalType(LogicalTypeID typeID)
KUZU_API LogicalTypeID getLogicalTypeID() const
Definition types.h:224
static LogicalType UINT64()
Definition types.h:249
static LogicalType STRING()
Definition types.h:266
friend struct CAPIHelper
Definition types.h:302
static LogicalType ANY()
Definition types.h:242
static LogicalType BLOB()
Definition types.h:267
static KUZU_API LogicalType STRUCT(std::vector< StructField > &&fields)
static KUZU_API LogicalType MAP(LogicalType keyType, LogicalType valueType)
static LogicalType TIMESTAMP_MS()
Definition types.h:258
static LogicalType TIMESTAMP()
Definition types.h:261
friend struct JavaAPIHelper
Definition types.h:303
static LogicalType ARRAY(T &&childType, uint64_t numElements)
Definition types.h:297
static LogicalType SERIAL()
Definition types.h:265
static bool tryConvertFromString(const std::string &str, LogicalType &type)
static LogicalType TIMESTAMP_TZ()
Definition types.h:260
static LogicalType MAP(T &&keyType, T &&valueType)
Definition types.h:290
static KUZU_API std::vector< LogicalType > copy(const std::vector< LogicalType > &types)
KUZU_API bool operator!=(const LogicalType &other) const
static LogicalType POINTER()
Definition types.h:269
static LogicalType UINT16()
Definition types.h:251
static KUZU_API LogicalType REL(std::unique_ptr< StructTypeInfo > typeInfo)
KUZU_API PhysicalTypeID getPhysicalType() const
Definition types.h:227
static KUZU_API LogicalType NODE(std::unique_ptr< StructTypeInfo > typeInfo)
static KUZU_API LogicalType RDF_VARIANT()
static LogicalType UINT8()
Definition types.h:252
static KUZU_API PhysicalTypeID getPhysicalType(LogicalTypeID logicalType, const std::unique_ptr< ExtraTypeInfo > &extraTypeInfo=nullptr)
Definition serializer.h:15
Definition types.h:399
std::string getName() const
Definition types.h:405
StructField copy() const
StructField()
Definition types.h:401
const LogicalType & getType() const
Definition types.h:407
static StructField deserialize(Deserializer &deserializer)
bool operator==(const StructField &other) const
StructField(std::string name, LogicalType type)
Definition types.h:402
bool operator!=(const StructField &other) const
Definition types.h:412
void serialize(Serializer &serializer) const
Definition types.h:425
bool containsAny() const override
const StructField & getStructField(const std::string &fieldName) const
const LogicalType & getChildType(struct_field_idx_t idx) const
StructTypeInfo(std::vector< StructField > &&fields)
StructTypeInfo(const std::vector< std::string > &fieldNames, const std::vector< LogicalType > &fieldTypes)
const std::vector< StructField > & getStructFields() const
std::vector< std::string > getChildrenNames() const
const StructField & getStructField(struct_field_idx_t idx) const
struct_field_idx_t getStructFieldIdx(std::string fieldName) const
std::vector< const LogicalType * > getChildrenTypes() const
std::unique_ptr< ExtraTypeInfo > copy() const override
bool operator==(const ExtraTypeInfo &other) const override
bool hasField(const std::string &fieldName) const
static std::unique_ptr< ExtraTypeInfo > deserialize(Deserializer &deserializer)
Definition types.h:103
Definition types.h:120
Definition types.h:107
Definition types.h:124
Definition types.h:110
Definition types.h:94
Definition types.h:100
uint64_t length_t
Definition types.h:53
constexpr uint32_t UNDEFINED_CAST_COST
Definition types.h:48
constexpr page_idx_t INVALID_PAGE_IDX
Definition types.h:29
constexpr column_id_t ROW_IDX_COLUMN_ID
Definition types.h:38
page_group_idx_t frame_group_idx_t
Definition types.h:33
uint64_t hash_t
Definition types.h:25
uint32_t idx_t
Definition types.h:39
page_idx_t frame_idx_t
Definition types.h:27
uint64_t node_group_idx_t
Definition types.h:49
PhysicalTypeID
Definition types.h:171
FileVersionType
Definition types.h:556
constexpr struct_field_idx_t INVALID_STRUCT_FIELD_IDX
Definition types.h:45
uint32_t file_idx_t
Definition types.h:30
constexpr idx_t INVALID_IDX
Definition types.h:40
property_id_t column_id_t
Definition types.h:36
constexpr property_id_t INVALID_PROPERTY_ID
Definition types.h:35
uint64_t block_idx_t
Definition types.h:41
constexpr node_group_idx_t INVALID_NODE_GROUP_IDX
Definition types.h:50
uint32_t page_group_idx_t
Definition types.h:32
constexpr transaction_t INVALID_TRANSACTION
Definition types.h:58
uint32_t page_offset_t
Definition types.h:28
uint32_t property_id_t
Definition types.h:34
std::unordered_map< executor_id_t, uint64_t > executor_info
Definition types.h:60
uint64_t transaction_t
Definition types.h:57
uint64_t partition_idx_t
Definition types.h:51
std::vector< LogicalType > logical_type_vec_t
Definition types.h:458
constexpr file_idx_t INVALID_FILE_IDX
Definition types.h:31
struct_field_idx_t union_field_idx_t
Definition types.h:44
constexpr block_idx_t INVALID_BLOCK_IDX
Definition types.h:42
uint64_t executor_id_t
Definition types.h:59
constexpr offset_t INVALID_OFFSET
Definition internal_id_t.h:23
constexpr partition_idx_t INVALID_PARTITION_IDX
Definition types.h:52
constexpr row_idx_t INVALID_ROW_IDX
Definition types.h:47
uint32_t page_idx_t
Definition types.h:26
uint32_t list_size_t
Definition types.h:54
constexpr column_id_t INVALID_COLUMN_ID
Definition types.h:37
uint64_t sel_t
Definition types.h:24
uint64_t sequence_id_t
Definition types.h:55
TO ku_dynamic_cast(FROM old)
Definition cast.h:11
LogicalTypeID
Definition types.h:126
uint64_t offset_t
Definition internal_id_t.h:22
uint8_t struct_field_idx_t
Definition types.h:43
uint64_t row_idx_t
Definition types.h:46
Definition alter_type.h:5
Definition types.h:470
static uint64_t getNumElements(const LogicalType &type)
static const LogicalType & getChildType(const LogicalType &type)
Definition types.h:460
static uint32_t getPrecision(const LogicalType &type)
static uint32_t getScale(const LogicalType &type)
static std::string insertDecimalPoint(const std::string &value, uint32_t posFromEnd)
Definition types.h:466
static const LogicalType & getChildType(const LogicalType &type)
Definition types.h:525
static bool isUnsigned(const LogicalTypeID &dataType)
static bool tryGetMaxLogicalType(const LogicalType &left, const LogicalType &right, LogicalType &result)
static bool isIntegral(const LogicalTypeID &dataType)
static bool isNested(const LogicalType &dataType)
static bool isDate(const LogicalType &dataType)
static uint32_t getRowLayoutSize(const LogicalType &logicalType)
static std::vector< LogicalType > getAllValidLogicTypes()
static std::string toString(LogicalTypeID dataTypeID)
static bool isIntegral(const LogicalType &dataType)
static bool isDate(const LogicalTypeID &dataType)
static bool isUnsigned(const LogicalType &dataType)
static std::vector< LogicalTypeID > getNumericalLogicalTypeIDs()
static std::vector< LogicalTypeID > getAllValidComparableLogicalTypes()
static std::string toString(const std::vector< LogicalType > &dataTypes)
static bool tryGetMaxLogicalType(const std::vector< LogicalType > &types, LogicalType &result)
static bool isNested(LogicalTypeID logicalTypeID)
static bool isTimestamp(const LogicalType &dataType)
static std::vector< LogicalTypeID > getAllValidLogicTypeIDs()
static std::string toString(const std::vector< LogicalTypeID > &dataTypeIDs)
static bool isTimestamp(const LogicalTypeID &dataType)
static bool isNumerical(const LogicalTypeID &dataType)
static std::vector< LogicalTypeID > getIntegerTypeIDs()
static bool isNumerical(const LogicalType &dataType)
Definition types.h:498
static const LogicalType & getValueType(const LogicalType &type)
static const LogicalType & getKeyType(const LogicalType &type)
Definition types.h:520
static uint32_t getFixedTypeSize(PhysicalTypeID physicalType)
static std::string toString(PhysicalTypeID physicalType)
Definition types.h:475
static const StructField & getField(const LogicalType &type, const std::string &key)
static const std::vector< StructField > & getFields(const LogicalType &type)
static std::vector< const LogicalType * > getFieldTypes(const LogicalType &type)
static const LogicalType & getFieldType(const LogicalType &type, struct_field_idx_t idx)
static uint64_t getNumFields(const LogicalType &type)
static const StructField & getField(const LogicalType &type, struct_field_idx_t idx)
static struct_field_idx_t getFieldIdx(const LogicalType &type, const std::string &key)
static const LogicalType & getFieldType(const LogicalType &type, const std::string &key)
static bool hasField(const LogicalType &type, const std::string &key)
static std::vector< std::string > getFieldNames(const LogicalType &type)
Definition uuid.h:15
Definition types.h:504
static union_field_idx_t getInternalFieldIdx(union_field_idx_t idx)
static std::string getFieldName(const LogicalType &type, union_field_idx_t idx)
static const LogicalType & getFieldType(const LogicalType &type, union_field_idx_t idx)
static uint64_t getNumFields(const LogicalType &type)
Definition int128_t.h:20
Definition ku_string.h:12
Definition types.h:70
offset_t offset
Definition types.h:71
list_entry_t(offset_t offset, list_size_t size)
Definition types.h:75
list_size_t size
Definition types.h:72
list_entry_t()
Definition types.h:74
Definition types.h:82
list_entry_t entry
Definition types.h:83
Definition types.h:63
uint64_t numElements
Definition types.h:66
uint8_t * value
Definition types.h:67
Definition types.h:78
int64_t pos
Definition types.h:79
Definition types.h:86
struct_entry_t entry
Definition types.h:87