Iceberg.Schema (iceberg v0.1.0)

Copy Markdown View Source

Builds an Iceberg schema (in the spec's JSON shape) from field tuples.

Iceberg.Schema.new([
  {"id", :long, required: true},
  {"tags", {:list, :string}},
  {"point", {:struct, [{"x", :double}, {"y", :double}]}}
])

Field ids are assigned in order, top-level fields first. Types: :boolean, :int, :long, :float, :double, :date, :time, :timestamp, :timestamptz, :timestamp_ns, :timestamptz_ns, :string, :uuid, :binary, {:decimal, precision, scale}, {:fixed, length}, {:list, type}, {:map, key_type, value_type} and {:struct, fields}. Field options: :required (default false) and :doc.

Summary

Types

field()

@type field() :: {String.t(), type()} | {String.t(), type(), keyword()}

type()

@type type() :: atom() | tuple()

Functions

new(fields)

@spec new([field()]) :: map()