iceberg-cpp
Loading...
Searching...
No Matches
Functions
Factory functions for creating data types

Functions

ICEBERG_EXPORT const std::shared_ptr< BooleanType > & iceberg::boolean ()
 Return a BooleanType instance.
 
ICEBERG_EXPORT const std::shared_ptr< IntType > & iceberg::int32 ()
 Return an IntType instance.
 
ICEBERG_EXPORT const std::shared_ptr< LongType > & iceberg::int64 ()
 Return a LongType instance.
 
ICEBERG_EXPORT const std::shared_ptr< FloatType > & iceberg::float32 ()
 Return a FloatType instance.
 
ICEBERG_EXPORT const std::shared_ptr< DoubleType > & iceberg::float64 ()
 Return a DoubleType instance.
 
ICEBERG_EXPORT const std::shared_ptr< DateType > & iceberg::date ()
 Return a DateType instance.
 
ICEBERG_EXPORT const std::shared_ptr< TimeType > & iceberg::time ()
 Return a TimeType instance.
 
ICEBERG_EXPORT const std::shared_ptr< TimestampType > & iceberg::timestamp ()
 Return a TimestampType instance.
 
ICEBERG_EXPORT const std::shared_ptr< TimestampTzType > & iceberg::timestamp_tz ()
 Return a TimestampTzType instance.
 
ICEBERG_EXPORT const std::shared_ptr< TimestampNsType > & iceberg::timestamp_ns ()
 Return a TimestampNsType instance.
 
ICEBERG_EXPORT const std::shared_ptr< TimestampTzNsType > & iceberg::timestamptz_ns ()
 Return a TimestampTzNsType instance.
 
ICEBERG_EXPORT const std::shared_ptr< BinaryType > & iceberg::binary ()
 Return a BinaryType instance.
 
ICEBERG_EXPORT const std::shared_ptr< StringType > & iceberg::string ()
 Return a StringType instance.
 
ICEBERG_EXPORT const std::shared_ptr< UuidType > & iceberg::uuid ()
 Return a UuidType instance.
 
ICEBERG_EXPORT const std::shared_ptr< UnknownType > & iceberg::unknown ()
 Return an UnknownType instance.
 
ICEBERG_EXPORT const std::shared_ptr< VariantType > & iceberg::variant ()
 Return a VariantType instance.
 
const std::shared_ptr< GeometryType > & iceberg::geometry ()
 Return the default GeometryType instance.
 
const std::shared_ptr< GeographyType > & iceberg::geography ()
 Return the default GeographyType instance.
 
std::shared_ptr< DecimalTypeiceberg::decimal (int32_t precision, int32_t scale)
 Create a DecimalType with the given precision and scale.
 
std::shared_ptr< FixedTypeiceberg::fixed (int32_t length)
 Create a FixedType with the given length.
 
std::shared_ptr< GeometryTypeiceberg::geometry (std::string crs)
 Create a GeometryType with the given CRS.
 
std::shared_ptr< GeographyTypeiceberg::geography (std::string crs)
 Create a GeographyType with the given CRS.
 
std::shared_ptr< GeographyTypeiceberg::geography (std::string crs, EdgeAlgorithm algorithm)
 Create a GeographyType with the given CRS and edge algorithm.
 
std::shared_ptr< StructTypeiceberg::struct_ (std::vector< SchemaField > fields)
 Create a StructType with the given fields.
 
std::shared_ptr< ListTypeiceberg::list (SchemaField element)
 Create a ListType with the given element field.
 
std::shared_ptr< MapTypeiceberg::map (SchemaField key, SchemaField value)
 Create a MapType with the given key and value fields.
 

Detailed Description

Factory functions for creating data types

Function Documentation

◆ decimal()

ICEBERG_EXPORT std::shared_ptr< DecimalType > iceberg::decimal ( int32_t  precision,
int32_t  scale 
)

Create a DecimalType with the given precision and scale.

Parameters
precisionThe number of decimal digits (max 38).
scaleThe number of decimal digits after the decimal point.
Returns
A shared pointer to the DecimalType instance.
Exceptions
IcebergErrorif precision is outside the supported range.

◆ fixed()

ICEBERG_EXPORT std::shared_ptr< FixedType > iceberg::fixed ( int32_t  length)

Create a FixedType with the given length.

Parameters
lengthThe number of bytes to store (must be >= 0).
Returns
A shared pointer to the FixedType instance.
Exceptions
IcebergErrorif length is negative.

◆ geography() [1/2]

ICEBERG_EXPORT std::shared_ptr< GeographyType > iceberg::geography ( std::string  crs)

Create a GeographyType with the given CRS.

Exceptions
IcebergErrorif crs is empty.

◆ geography() [2/2]

ICEBERG_EXPORT std::shared_ptr< GeographyType > iceberg::geography ( std::string  crs,
EdgeAlgorithm  algorithm 
)

Create a GeographyType with the given CRS and edge algorithm.

Exceptions
IcebergErrorif crs is empty.

◆ geometry()

ICEBERG_EXPORT std::shared_ptr< GeometryType > iceberg::geometry ( std::string  crs)

Create a GeometryType with the given CRS.

Exceptions
IcebergErrorif crs is empty.

◆ list()

ICEBERG_EXPORT std::shared_ptr< ListType > iceberg::list ( SchemaField  element)

Create a ListType with the given element field.

Parameters
elementThe element field of the list.
Returns
A shared pointer to the ListType instance.
Exceptions
IcebergErrorif element's name is not "element".

◆ map()

ICEBERG_EXPORT std::shared_ptr< MapType > iceberg::map ( SchemaField  key,
SchemaField  value 
)

Create a MapType with the given key and value fields.

Parameters
keyThe key field of the map.
valueThe value field of the map.
Returns
A shared pointer to the MapType instance.
Exceptions
IcebergErrorif the key or value field has an invalid name.

◆ struct_()

ICEBERG_EXPORT std::shared_ptr< StructType > iceberg::struct_ ( std::vector< SchemaField fields)

Create a StructType with the given fields.

Parameters
fieldsThe fields of the struct.
Returns
A shared pointer to the StructType instance.