Skip to main content

Module relations

Module relations 

Source

StructsΒ§

Column
ExtensionReadRel πŸ”’
Parsed Read:Extension[columns] relation. Needs a newtype because the proto type is ReadRel (same as NamedTable and VirtualTable), but the read detail is supplied by a required + Ext: addendum.
NamedColumnList πŸ”’
RelationParsingContext
Parsing context for relations that includes extensions, registry, and optional warning collection
TableName
VirtualReadRel πŸ”’
Parsed Read:Virtual[rows => columns] relation. Needs a newtype because the proto type is ReadRel (same as NamedTable), but the grammar and handling are different.

TraitsΒ§

RelationParsePair
A trait for parsing relations with full context for tree building.

FunctionsΒ§

build_grouping_fields πŸ”’
Deduplicates expressions across all sets and produces the AggregateRel’s protobuf fields: a flat deduplicated expression list and per-set Grouping messages with index references into that list.
build_named_struct πŸ”’
Build a NamedStruct from parsed columns.
direct_common πŸ”’
A RelCommon with an explicit Direct emit.
expect_one_child πŸ”’
This is a utility function for extracting a single child from the list of children, to be used in the RelationParsePair trait. The RelationParsePair trait passes a Vec of children, because some relations have multiple children - but most accept exactly one child.
expression_key πŸ”’
Encodes an expression to bytes for use as a structural-equality map key. TODO: use a better key here than encoding to bytes. Ideally, substrait-rs would support PartialEq and Hash, but as there isn’t an easy way to do that now, we’ll skip.
i64_literal_expr πŸ”’
make_emit πŸ”’
Build an emit: Direct if the mapping is the identity [0, 1, ..., N-1] (where N = direct_output_count), otherwise Emit with the explicit mapping.
parse_aggregate_output πŸ”’
Parses the output section of an aggregate (everything after =>).
parse_emit πŸ”’
Parse a reference list into an emit and output field count.
parse_emit_suffix πŸ”’
parse_expression_list πŸ”’
Grammar: expression_list = { expression ~ ("," ~ expression)* }
parse_grouping_set πŸ”’
Parses a single grouping set, e.g. ($0, $1) or _.
parse_grouping_sets πŸ”’
Parses the grouping section of an aggregate (everything before =>).
parse_output πŸ”’
parse_output_mapping πŸ”’
Parse a reference list Pair and return an EmitKind::Emit. Parse a reference list into field indices for emit mapping.
parse_set_relation_pair πŸ”’
Parse a set_relation pair given the real per-child output widths (not just their sum), so mismatched input schemas are always caught
parse_virtual_read_rows πŸ”’
Read:Virtual rows: either empty or a list of row tuples.
parse_virtual_row πŸ”’
Parse a single virtual_row ((expr, expr, ...) or ()) into a nested::Struct.