Expand description
Fundamental data representation.
This module contains the types for representing data in Materialize that all layers of the stack can understand. Think of it as the lingua franca: individual layers may use different representations internally, but they all agree to use this representation at their boundaries.
- The core value type is the
Datum
enum, which represents a literal value. Row
extends aDatum
horizontally, and has features for efficiently doing so.RelationDesc
describes what it takes to extend aRow
vertically, and corresponds most closely to what is returned from querying our dataflows
Re-exports§
pub use crate::catalog_item_id::CatalogItemId;
pub use crate::global_id::GlobalId;
pub use crate::timestamp::Timestamp;
pub use crate::timestamp::TimestampManipulation;
Modules§
- Abstract data types.
- A re-useable vector of
Datum
with varying lifetimes. - diff 🔒
- A set of traits for modeling things that can be explained by a SQL
EXPLAIN
statement. - Provides abstractions for types that can be converted from and into
Datum
iterators.Row
is the most obvious implementor, but other trace types that may use more advanced representations only need to commit to implementing these traits. - Namespace constants to share between high- and low-levels of the system.
- Facilities for defining optimizer feature flags.
- relation 🔒
- row 🔒
- scalar 🔒
- Persist Stats for non-primitive types.
- Routines for converting datum values to and from their string representation.
- Custom Protobuf types for the
url
crate.
Structs§
- The name of a column in a
RelationDesc
. - The type of a
Datum
. - A sequence of Datums
- A mapping from string keys to Datums
- A re-useable vector of
Datum
with no particular lifetime. - A borrowed allocation of
Datum
with a specific lifetime. - Expression violated not-null constraint on named column
- See [dec::to_packed_bcd] and http://speleotrove.com/decimal/dnpack.html for more information on this format.
- A description of the shape of a relation.
- A builder for a
RelationDesc
. - The type of a relation.
- The version a given column was added at.
- A packed representation for
Datum
s. RowArena
is used to hold on to temporaryRow
s for functions likeeval
that need to create complexDatum
s but don’t have aRow
to put them in yet.- A
ColumnDecoder
for aRow
. - A
ColumnEncoder
for aRow
. - Packs datums into a
Row
. - A contiguous slice of bytes that are row data.
- A thread-local row, which can be borrowed and returned.
- A wrapper around
RelationDesc
that provides an interface for adding columns and generating new versions.
Enums§
- A single value.
- A mirror type for
Datum
that can be proptest-generated. - Diffs that can be generated proptest and applied to a
RelationDesc
to exercise schema migrations. - Describes a
RelationDesc
at a specific version of aVersionedRelationDesc
. - The type of a
Datum
.
Traits§
- Types that implement this trait can be stored in an SQL column with the specified ColumnType
- A bridge between native Rust types and SQL runtime types represented in Datums
- Convert a type into a
RowIterator
. - An iterator that can borrow from
self
and yieldRowRef
s.
Functions§
- Generate an arbitrary
PropDatum
. - Generates an arbitrary
PropDatum
for the providedColumnType
. - Generates an arbitrary
PropDatum
for the providedScalarType
. - Generates a set of
PropRelationDescDiff
s based on some sourceRelationDesc
. - Number of bytes required by a list of datums. This computes the size that would be required if the given datums were packed into a list.
- Number of bytes required by the datum. This is used to optimistically pre-allocate buffers for packing rows.
- Number of bytes required by a sequence of datums.
- Returns true iff the ordering of the “raw” and Persist-encoded versions of this columm would match: ie.
sort(encode(column)) == encode(sort(column))
. This encoding has been designed so that this is true for many types. - Read a datum starting at byte
offset
. - Return the number of bytes these Datums would use if packed as a Row.
Type Aliases§
- System-wide record count difference type.