execute_columnar_aggregate

Function execute_columnar_aggregate 

Source
pub fn execute_columnar_aggregate(
    rows: &[Row],
    predicates: &[ColumnPredicate],
    aggregates: &[AggregateSpec],
    schema: Option<&CombinedSchema>,
) -> Result<Vec<Row>, ExecutorError>
Expand description

Execute a columnar aggregate query with filtering

This is a simplified entry point for columnar execution that demonstrates the full pipeline: scan → filter → aggregate.

§Arguments

  • rows - Input rows to process
  • predicates - Column predicates for filtering (optional)
  • aggregates - List of (column_index, aggregate_op) pairs to compute

§Returns

A single Row containing the computed aggregate values

§Example

// Compute SUM(col0), AVG(col1) WHERE col2 < 100
let predicates = vec![
    ColumnPredicate::LessThan {
        column_idx: 2,
        value: SqlValue::Integer(100),
    },
];
let aggregates = vec![
    (0, AggregateOp::Sum),
    (1, AggregateOp::Avg),
];

let result = execute_columnar_aggregate(&rows, &predicates, &aggregates)?;

Note: This function provides SIMD-accelerated filtering and aggregation through LLVM auto-vectorization of batch-native operations.