iceberg-cpp
Loading...
Searching...
No Matches
type.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#pragma once
21
25
26#include <array>
27#include <cstdint>
28#include <memory>
29#include <optional>
30#include <span>
31#include <string>
32#include <unordered_map>
33#include <vector>
34
35#include "iceberg/iceberg_export.h"
36#include "iceberg/result.h"
39#include "iceberg/util/lazy.h"
40
41namespace iceberg {
42
44class ICEBERG_EXPORT Type : public iceberg::util::Formattable {
45 public:
46 ~Type() override = default;
47
49 virtual TypeId type_id() const = 0;
50
52 virtual bool is_primitive() const = 0;
53
55 virtual bool is_nested() const = 0;
56
58 bool is_struct() const { return type_id() == TypeId::kStruct; }
59
61 bool is_list() const { return type_id() == TypeId::kList; }
62
64 bool is_map() const { return type_id() == TypeId::kMap; }
65
67 bool is_variant() const { return type_id() == TypeId::kVariant; }
68
70 friend bool operator==(const Type& lhs, const Type& rhs) { return lhs.Equals(rhs); }
71
72 protected:
74 virtual bool Equals(const Type& other) const = 0;
75};
76
78class ICEBERG_EXPORT PrimitiveType : public Type {
79 public:
80 bool is_primitive() const override { return true; }
81 bool is_nested() const override { return false; }
82};
83
85class ICEBERG_EXPORT NestedType : public Type {
86 public:
87 bool is_primitive() const override { return false; }
88 bool is_nested() const override { return true; }
89
91 virtual std::span<const SchemaField> fields() const = 0;
92 using SchemaFieldConstRef = std::reference_wrapper<const SchemaField>;
96 virtual Result<std::optional<SchemaFieldConstRef>> GetFieldById(
97 int32_t field_id) const = 0;
101 virtual Result<std::optional<SchemaFieldConstRef>> GetFieldByIndex(
102 int32_t index) const = 0;
108 virtual Result<std::optional<SchemaFieldConstRef>> GetFieldByName(
109 std::string_view name, bool case_sensitive) const = 0;
111 Result<std::optional<SchemaFieldConstRef>> GetFieldByName(std::string_view name) const;
112};
113
117
119class ICEBERG_EXPORT StructType : public NestedType {
120 public:
121 constexpr static TypeId kTypeId = TypeId::kStruct;
122 explicit StructType(std::vector<SchemaField> fields);
123 ~StructType() override = default;
124
125 TypeId type_id() const override;
126 std::string ToString() const override;
127
128 std::span<const SchemaField> fields() const override;
129 Result<std::optional<SchemaFieldConstRef>> GetFieldById(
130 int32_t field_id) const override;
131 Result<std::optional<SchemaFieldConstRef>> GetFieldByIndex(
132 int32_t index) const override;
133 Result<std::optional<SchemaFieldConstRef>> GetFieldByName(
134 std::string_view name, bool case_sensitive) const override;
135 using NestedType::GetFieldByName;
136
137 std::unique_ptr<Schema> ToSchema() const;
138
139 protected:
140 bool Equals(const Type& other) const override;
141
142 static Result<std::unordered_map<int32_t, SchemaFieldConstRef>> InitFieldById(
143 const StructType&);
144 static Result<std::unordered_map<std::string_view, SchemaFieldConstRef>>
145 InitFieldByName(const StructType&);
146 static Result<std::unordered_map<std::string, SchemaFieldConstRef>>
147 InitFieldByLowerCaseName(const StructType&);
148
149 std::vector<SchemaField> fields_;
150 Lazy<InitFieldById> field_by_id_;
151 Lazy<InitFieldByName> field_by_name_;
152 Lazy<InitFieldByLowerCaseName> field_by_lowercase_name_;
153};
154
156class ICEBERG_EXPORT ListType : public NestedType {
157 public:
158 constexpr static const TypeId kTypeId = TypeId::kList;
159 constexpr static const std::string_view kElementName = "element";
160
161 static Result<std::unique_ptr<ListType>> Make(SchemaField element);
162
166 explicit ListType(SchemaField element);
168 ListType(int32_t field_id, std::shared_ptr<Type> type, bool optional);
169 ~ListType() override = default;
170
171 TypeId type_id() const override;
172 const SchemaField& element() const;
173 std::string ToString() const override;
174
175 std::span<const SchemaField> fields() const override;
176 Result<std::optional<SchemaFieldConstRef>> GetFieldById(
177 int32_t field_id) const override;
178 Result<std::optional<SchemaFieldConstRef>> GetFieldByIndex(
179 int32_t index) const override;
180 Result<std::optional<SchemaFieldConstRef>> GetFieldByName(
181 std::string_view name, bool case_sensitive) const override;
182 using NestedType::GetFieldByName;
183
184 protected:
185 bool Equals(const Type& other) const override;
186
187 SchemaField element_;
188};
189
191class ICEBERG_EXPORT MapType : public NestedType {
192 public:
193 constexpr static const TypeId kTypeId = TypeId::kMap;
194 constexpr static const std::string_view kKeyName = "key";
195 constexpr static const std::string_view kValueName = "value";
196
197 static Result<std::unique_ptr<MapType>> Make(SchemaField key, SchemaField value);
198
202 explicit MapType(SchemaField key, SchemaField value);
203 ~MapType() override = default;
204
205 const SchemaField& key() const;
206 const SchemaField& value() const;
207
208 TypeId type_id() const override;
209 std::string ToString() const override;
210
211 std::span<const SchemaField> fields() const override;
212 Result<std::optional<SchemaFieldConstRef>> GetFieldById(
213 int32_t field_id) const override;
214 Result<std::optional<SchemaFieldConstRef>> GetFieldByIndex(
215 int32_t index) const override;
216 Result<std::optional<SchemaFieldConstRef>> GetFieldByName(
217 std::string_view name, bool case_sensitive) const override;
218 using NestedType::GetFieldByName;
219
220 protected:
221 bool Equals(const Type& other) const override;
222
223 std::array<SchemaField, 2> fields_;
224};
225
227
231
233class ICEBERG_EXPORT VariantType : public Type {
234 public:
235 constexpr static const TypeId kTypeId = TypeId::kVariant;
236
237 VariantType() = default;
238 ~VariantType() override = default;
239
240 bool is_primitive() const override { return false; }
241 bool is_nested() const override { return false; }
242
243 TypeId type_id() const override;
244 std::string ToString() const override;
245
246 protected:
247 bool Equals(const Type& other) const override;
248};
249
251
255
257class ICEBERG_EXPORT BooleanType : public PrimitiveType {
258 public:
259 constexpr static const TypeId kTypeId = TypeId::kBoolean;
260
261 BooleanType() = default;
262 ~BooleanType() override = default;
263
264 TypeId type_id() const override;
265 std::string ToString() const override;
266
267 protected:
268 bool Equals(const Type& other) const override;
269};
270
272class ICEBERG_EXPORT IntType : public PrimitiveType {
273 public:
274 constexpr static const TypeId kTypeId = TypeId::kInt;
275
276 IntType() = default;
277 ~IntType() override = default;
278
279 TypeId type_id() const override;
280 std::string ToString() const override;
281
282 protected:
283 bool Equals(const Type& other) const override;
284};
285
287class ICEBERG_EXPORT LongType : public PrimitiveType {
288 public:
289 constexpr static const TypeId kTypeId = TypeId::kLong;
290
291 LongType() = default;
292 ~LongType() override = default;
293
294 TypeId type_id() const override;
295 std::string ToString() const override;
296
297 protected:
298 bool Equals(const Type& other) const override;
299};
300
303class ICEBERG_EXPORT FloatType : public PrimitiveType {
304 public:
305 constexpr static const TypeId kTypeId = TypeId::kFloat;
306
307 FloatType() = default;
308 ~FloatType() override = default;
309
310 TypeId type_id() const override;
311 std::string ToString() const override;
312
313 protected:
314 bool Equals(const Type& other) const override;
315};
316
319class ICEBERG_EXPORT DoubleType : public PrimitiveType {
320 public:
321 constexpr static const TypeId kTypeId = TypeId::kDouble;
322
323 DoubleType() = default;
324 ~DoubleType() override = default;
325
326 TypeId type_id() const override;
327 std::string ToString() const override;
328
329 protected:
330 bool Equals(const Type& other) const override;
331};
332
334class ICEBERG_EXPORT DecimalType : public PrimitiveType {
335 public:
336 constexpr static const TypeId kTypeId = TypeId::kDecimal;
337 constexpr static const int32_t kMaxPrecision = 38;
338
341 DecimalType(int32_t precision, int32_t scale);
342 ~DecimalType() override = default;
343
345 int32_t precision() const;
348 int32_t scale() const;
349
350 TypeId type_id() const override;
351 std::string ToString() const override;
352
353 protected:
354 bool Equals(const Type& other) const override;
355
356 private:
357 int32_t precision_;
358 int32_t scale_;
359};
360
363class ICEBERG_EXPORT DateType : public PrimitiveType {
364 public:
365 constexpr static const TypeId kTypeId = TypeId::kDate;
366
367 DateType() = default;
368 ~DateType() override = default;
369
370 TypeId type_id() const override;
371 std::string ToString() const override;
372
373 protected:
374 bool Equals(const Type& other) const override;
375};
376
379class ICEBERG_EXPORT TimeType : public PrimitiveType {
380 public:
381 constexpr static const TypeId kTypeId = TypeId::kTime;
382
383 TimeType() = default;
384 ~TimeType() override = default;
385
386 TypeId type_id() const override;
387 std::string ToString() const override;
388
389 protected:
390 bool Equals(const Type& other) const override;
391};
392
395class ICEBERG_EXPORT TimestampBase : public PrimitiveType {
396 public:
398 virtual bool is_zoned() const = 0;
400 virtual TimeUnit time_unit() const = 0;
401};
402
405class ICEBERG_EXPORT TimestampType : public TimestampBase {
406 public:
407 constexpr static const TypeId kTypeId = TypeId::kTimestamp;
408
409 TimestampType() = default;
410 ~TimestampType() override = default;
411
412 bool is_zoned() const override;
413 TimeUnit time_unit() const override;
414
415 TypeId type_id() const override;
416 std::string ToString() const override;
417
418 protected:
419 bool Equals(const Type& other) const override;
420};
421
424class ICEBERG_EXPORT TimestampTzType : public TimestampBase {
425 public:
426 constexpr static const TypeId kTypeId = TypeId::kTimestampTz;
427
428 TimestampTzType() = default;
429 ~TimestampTzType() override = default;
430
431 bool is_zoned() const override;
432 TimeUnit time_unit() const override;
433
434 TypeId type_id() const override;
435 std::string ToString() const override;
436
437 protected:
438 bool Equals(const Type& other) const override;
439};
440
443class ICEBERG_EXPORT TimestampNsType : public TimestampBase {
444 public:
445 constexpr static const TypeId kTypeId = TypeId::kTimestampNs;
446
447 TimestampNsType() = default;
448 ~TimestampNsType() override = default;
449
450 bool is_zoned() const override;
451 TimeUnit time_unit() const override;
452
453 TypeId type_id() const override;
454 std::string ToString() const override;
455
456 protected:
457 bool Equals(const Type& other) const override;
458};
459
462class ICEBERG_EXPORT TimestampTzNsType : public TimestampBase {
463 public:
464 constexpr static const TypeId kTypeId = TypeId::kTimestampTzNs;
465
466 TimestampTzNsType() = default;
467 ~TimestampTzNsType() override = default;
468
469 bool is_zoned() const override;
470 TimeUnit time_unit() const override;
471
472 TypeId type_id() const override;
473 std::string ToString() const override;
474
475 protected:
476 bool Equals(const Type& other) const override;
477};
478
480class ICEBERG_EXPORT BinaryType : public PrimitiveType {
481 public:
482 constexpr static const TypeId kTypeId = TypeId::kBinary;
483
484 BinaryType() = default;
485 ~BinaryType() override = default;
486
487 TypeId type_id() const override;
488 std::string ToString() const override;
489
490 protected:
491 bool Equals(const Type& other) const override;
492};
493
496class ICEBERG_EXPORT StringType : public PrimitiveType {
497 public:
498 constexpr static const TypeId kTypeId = TypeId::kString;
499
500 StringType() = default;
501 ~StringType() override = default;
502
503 TypeId type_id() const override;
504 std::string ToString() const override;
505
506 protected:
507 bool Equals(const Type& other) const override;
508};
509
511class ICEBERG_EXPORT FixedType : public PrimitiveType {
512 public:
513 constexpr static const TypeId kTypeId = TypeId::kFixed;
514
517 explicit FixedType(int32_t length);
518 ~FixedType() override = default;
519
521 int32_t length() const;
522
523 TypeId type_id() const override;
524 std::string ToString() const override;
525
526 protected:
527 bool Equals(const Type& other) const override;
528
529 private:
530 int32_t length_;
531};
532
535class ICEBERG_EXPORT UuidType : public PrimitiveType {
536 public:
537 constexpr static const TypeId kTypeId = TypeId::kUuid;
538
539 UuidType() = default;
540 ~UuidType() override = default;
541
542 TypeId type_id() const override;
543 std::string ToString() const override;
544
545 protected:
546 bool Equals(const Type& other) const override;
547};
548
550class ICEBERG_EXPORT UnknownType : public PrimitiveType {
551 public:
552 constexpr static const TypeId kTypeId = TypeId::kUnknown;
553
554 UnknownType() = default;
555 ~UnknownType() override = default;
556
557 TypeId type_id() const override;
558 std::string ToString() const override;
559
560 protected:
561 bool Equals(const Type& other) const override;
562};
563
565class ICEBERG_EXPORT GeometryType : public PrimitiveType {
566 public:
567 constexpr static const TypeId kTypeId = TypeId::kGeometry;
568 constexpr static std::string_view kDefaultCrs = "OGC:CRS84";
569
570 static Result<std::unique_ptr<GeometryType>> Make();
571 static Result<std::unique_ptr<GeometryType>> Make(std::string crs);
572 ~GeometryType() override = default;
573
574 std::string_view crs() const;
575
576 TypeId type_id() const override;
577 std::string ToString() const override;
578
579 protected:
580 bool Equals(const Type& other) const override;
581
582 private:
583 GeometryType() = default;
584 explicit GeometryType(std::string crs);
585
586 std::string crs_;
587};
588
590class ICEBERG_EXPORT GeographyType : public PrimitiveType {
591 public:
592 constexpr static const TypeId kTypeId = TypeId::kGeography;
593 constexpr static std::string_view kDefaultCrs = "OGC:CRS84";
594 constexpr static EdgeAlgorithm kDefaultAlgorithm = EdgeAlgorithm::kSpherical;
595
596 static Result<std::unique_ptr<GeographyType>> Make();
597 static Result<std::unique_ptr<GeographyType>> Make(std::string crs);
598 static Result<std::unique_ptr<GeographyType>> Make(std::string crs,
599 EdgeAlgorithm algorithm);
600 ~GeographyType() override = default;
601
602 std::string_view crs() const;
603 EdgeAlgorithm algorithm() const;
604
605 TypeId type_id() const override;
606 std::string ToString() const override;
607
608 protected:
609 bool Equals(const Type& other) const override;
610
611 private:
612 GeographyType() = default;
613 explicit GeographyType(std::string crs);
614 GeographyType(std::string crs, EdgeAlgorithm algorithm);
615
616 std::string crs_;
617 std::optional<EdgeAlgorithm> algorithm_;
618};
619
621
626
628ICEBERG_EXPORT const std::shared_ptr<BooleanType>& boolean();
630ICEBERG_EXPORT const std::shared_ptr<IntType>& int32();
632ICEBERG_EXPORT const std::shared_ptr<LongType>& int64();
634ICEBERG_EXPORT const std::shared_ptr<FloatType>& float32();
636ICEBERG_EXPORT const std::shared_ptr<DoubleType>& float64();
638ICEBERG_EXPORT const std::shared_ptr<DateType>& date();
640ICEBERG_EXPORT const std::shared_ptr<TimeType>& time();
642ICEBERG_EXPORT const std::shared_ptr<TimestampType>& timestamp();
644ICEBERG_EXPORT const std::shared_ptr<TimestampTzType>& timestamp_tz();
646ICEBERG_EXPORT const std::shared_ptr<TimestampNsType>& timestamp_ns();
648ICEBERG_EXPORT const std::shared_ptr<TimestampTzNsType>& timestamptz_ns();
650ICEBERG_EXPORT const std::shared_ptr<BinaryType>& binary();
652ICEBERG_EXPORT const std::shared_ptr<StringType>& string();
654ICEBERG_EXPORT const std::shared_ptr<UuidType>& uuid();
656ICEBERG_EXPORT const std::shared_ptr<UnknownType>& unknown();
658ICEBERG_EXPORT const std::shared_ptr<VariantType>& variant();
660ICEBERG_EXPORT const std::shared_ptr<GeometryType>& geometry();
662ICEBERG_EXPORT const std::shared_ptr<GeographyType>& geography();
663
669ICEBERG_EXPORT std::shared_ptr<DecimalType> decimal(int32_t precision, int32_t scale);
670
675ICEBERG_EXPORT std::shared_ptr<FixedType> fixed(int32_t length);
676
679ICEBERG_EXPORT std::shared_ptr<GeometryType> geometry(std::string crs);
680
683ICEBERG_EXPORT std::shared_ptr<GeographyType> geography(std::string crs);
684
687ICEBERG_EXPORT std::shared_ptr<GeographyType> geography(std::string crs,
688 EdgeAlgorithm algorithm);
689
693ICEBERG_EXPORT std::shared_ptr<StructType> struct_(std::vector<SchemaField> fields);
694
699ICEBERG_EXPORT std::shared_ptr<ListType> list(SchemaField element);
700
706ICEBERG_EXPORT std::shared_ptr<MapType> map(SchemaField key, SchemaField value);
707
709
717ICEBERG_EXPORT std::string_view ToString(TypeId id);
718
720ICEBERG_EXPORT std::string_view ToString(EdgeAlgorithm algorithm);
721
723ICEBERG_EXPORT Result<EdgeAlgorithm> EdgeAlgorithmFromString(std::string_view name);
724
725} // namespace iceberg
A data type representing an arbitrary-length byte sequence.
Definition type.h:480
A data type representing a boolean (true or false).
Definition type.h:257
A data type representing a calendar date without reference to a timezone or time.
Definition type.h:363
A data type representing a fixed-precision decimal.
Definition type.h:334
A data type representing a 64-bit (double precision) IEEE-754 float.
Definition type.h:319
A data type representing a fixed-length bytestring.
Definition type.h:511
A data type representing a 32-bit (single precision) IEEE-754 float.
Definition type.h:303
A data type representing OGC geography in WKB format.
Definition type.h:590
A data type representing OGC geometry in WKB format.
Definition type.h:565
A data type representing a 32-bit signed integer.
Definition type.h:272
A data type representing a list of values.
Definition type.h:156
A data type representing a 64-bit signed integer.
Definition type.h:287
A data type representing a dictionary of values.
Definition type.h:191
A data type that has child fields.
Definition type.h:85
virtual std::span< const SchemaField > fields() const =0
Get a view of the child fields.
virtual Result< std::optional< SchemaFieldConstRef > > GetFieldByName(std::string_view name, bool case_sensitive) const =0
Get a field by name. Return an error Status if the field name is not unique; prefer GetFieldById or G...
virtual Result< std::optional< SchemaFieldConstRef > > GetFieldById(int32_t field_id) const =0
Get a field by field ID.
virtual Result< std::optional< SchemaFieldConstRef > > GetFieldByIndex(int32_t index) const =0
Get a field by index.
bool is_primitive() const override
Is this a primitive type (may not have child fields)?
Definition type.h:87
bool is_nested() const override
Is this a nested type (may have child fields)?
Definition type.h:88
A data type that does not have child fields.
Definition type.h:78
bool is_primitive() const override
Is this a primitive type (may not have child fields)?
Definition type.h:80
bool is_nested() const override
Is this a nested type (may have child fields)?
Definition type.h:81
A type combined with a name.
Definition schema_field.h:39
A data type representing an arbitrary-length character sequence (encoded in UTF-8).
Definition type.h:496
A data type representing a struct with nested fields.
Definition type.h:119
A data type representing a wall clock time in microseconds without reference to a timezone or date.
Definition type.h:379
A base class for any timestamp time (irrespective of unit or timezone).
Definition type.h:395
virtual bool is_zoned() const =0
Is this type zoned or naive?
virtual TimeUnit time_unit() const =0
The time resolution.
A data type representing a timestamp in nanoseconds without reference to a timezone.
Definition type.h:443
A data type representing a timestamp in microseconds without reference to a timezone.
Definition type.h:405
A data type representing a timestamp as nanoseconds since the epoch in UTC. A time zone or offset is ...
Definition type.h:462
A data type representing a timestamp as microseconds since the epoch in UTC. A time zone or offset is...
Definition type.h:424
Interface for a data type for a field.
Definition type.h:44
bool is_struct() const
Is this a struct type?
Definition type.h:58
virtual TypeId type_id() const =0
Get the type ID.
virtual bool is_primitive() const =0
Is this a primitive type (may not have child fields)?
virtual bool is_nested() const =0
Is this a nested type (may have child fields)?
bool is_variant() const
Is this a variant type?
Definition type.h:67
friend bool operator==(const Type &lhs, const Type &rhs)
Compare two types for equality.
Definition type.h:70
virtual bool Equals(const Type &other) const =0
Compare two types for equality.
bool is_list() const
Is this a list type?
Definition type.h:61
bool is_map() const
Is this a map type?
Definition type.h:64
A null-only placeholder type used when a more specific type is not known.
Definition type.h:550
A data type representing a UUID. While defined as a distinct type, it is effectively a fixed(16).
Definition type.h:535
A semi-structured type whose structure may vary across rows.
Definition type.h:233
bool is_nested() const override
Is this a nested type (may have child fields)?
Definition type.h:241
bool is_primitive() const override
Is this a primitive type (may not have child fields)?
Definition type.h:240
Interface for objects that can be formatted via std::format.
Definition formattable.h:36
const std::shared_ptr< GeographyType > & geography()
Return the default GeographyType instance.
Definition type.cc:518
ICEBERG_EXPORT const std::shared_ptr< TimestampNsType > & timestamp_ns()
Return a TimestampNsType instance.
ICEBERG_EXPORT const std::shared_ptr< VariantType > & variant()
Return a VariantType instance.
ICEBERG_EXPORT const std::shared_ptr< BinaryType > & binary()
Return a BinaryType instance.
ICEBERG_EXPORT const std::shared_ptr< DateType > & date()
Return a DateType instance.
std::shared_ptr< ListType > list(SchemaField element)
Create a ListType with the given element field.
Definition type.cc:567
ICEBERG_EXPORT const std::shared_ptr< TimestampTzType > & timestamp_tz()
Return a TimestampTzType instance.
ICEBERG_EXPORT const std::shared_ptr< UnknownType > & unknown()
Return an UnknownType instance.
ICEBERG_EXPORT const std::shared_ptr< TimeType > & time()
Return a TimeType instance.
ICEBERG_EXPORT const std::shared_ptr< DoubleType > & float64()
Return a DoubleType instance.
ICEBERG_EXPORT const std::shared_ptr< StringType > & string()
Return a StringType instance.
ICEBERG_EXPORT const std::shared_ptr< IntType > & int32()
Return an IntType instance.
ICEBERG_EXPORT const std::shared_ptr< TimestampType > & timestamp()
Return a TimestampType instance.
ICEBERG_EXPORT const std::shared_ptr< TimestampTzNsType > & timestamptz_ns()
Return a TimestampTzNsType instance.
std::shared_ptr< FixedType > fixed(int32_t length)
Create a FixedType with the given length.
Definition type.cc:531
ICEBERG_EXPORT const std::shared_ptr< FloatType > & float32()
Return a FloatType instance.
std::shared_ptr< StructType > struct_(std::vector< SchemaField > fields)
Create a StructType with the given fields.
Definition type.cc:575
const std::shared_ptr< GeometryType > & geometry()
Return the default GeometryType instance.
Definition type.cc:509
std::shared_ptr< DecimalType > decimal(int32_t precision, int32_t scale)
Create a DecimalType with the given precision and scale.
Definition type.cc:527
ICEBERG_EXPORT const std::shared_ptr< BooleanType > & boolean()
Return a BooleanType instance.
ICEBERG_EXPORT const std::shared_ptr< LongType > & int64()
Return a LongType instance.
ICEBERG_EXPORT const std::shared_ptr< UuidType > & uuid()
Return a UuidType instance.
TimeUnit
The time unit. In Iceberg V3 nanoseconds are also supported.
Definition type_fwd.h:62
EdgeAlgorithm
The algorithm used to interpolate geography edges.
Definition type_fwd.h:68
TypeId
A data type.
Definition type_fwd.h:35