compute_schema_for_pattern

Function compute_schema_for_pattern 

Source
pub fn compute_schema_for_pattern(
    inner_schema: &DFSchema,
    patterns: &[Option<TermPattern>],
    blank_node_mode: BlankNodeMatchingMode,
) -> Arc<DFSchema>
Expand description

Computes a DataFusion schema for a general pattern of RDF terms.

This lower-level function creates a schema that includes fields for all variables in the given pattern array. It extracts variable names from the pattern elements and creates corresponding fields in the output schema.

§Arguments

  • inner_schema - The base schema containing field types
  • patterns - An array of optional term patterns (variables, constants, or blank nodes)
  • blank_node_mode - How blank nodes in the pattern should be treated

§Returns

A reference-counted schema containing fields for all variables in the pattern

§Implementation Note

This function assumes that variable names do not clash, which is enforced by the SPARQL syntax.