Skip to main content

fused_output_schema

Function fused_output_schema 

Source
pub fn fused_output_schema(
    fields: &[String],
    tags: &[String],
    time_index: &str,
    field_kind: FieldKind,
) -> Result<DFSchemaRef>
Expand description

The columns a FusedSeries node produces.

With experimental_native_promql enabled, a value column is named by the caller’s FieldNames answer for the statement’s expression, not legacy planner expression text. Legacy headers in tests/cases/** are unaffected because the native route is opt-in and off by default.

The shape is the one the existing unary pipeline consumes — the time index, then the series fields, then the tags — and each column is declared the way the node’s own conversion reads it back: the time column is a non-nullable millisecond timestamp with no timezone, because every evaluated chunk is addressed on the statement’s grid and carries one; a field is a nullable Float64, because a grid point inside the statement’s interval can have no sample; and a tag is a nullable Utf8, because a range function drops the metric name and a series can be missing a label entirely. The output schema of a fused node: its time index, one column per field, then its tags.

field_kind says what a field column carries. The physical conversion reads the same kind off this schema and dispatches on it, so the schema and the batch it describes cannot disagree.