Skip to main content

dbx_core/sql/executor/
mod.rs

1//! SQL Query Executor Module
2
3use crate::error::DbxResult;
4use arrow::array::RecordBatch;
5use arrow::compute;
6use arrow::datatypes::Schema;
7use std::sync::Arc;
8
9pub mod expr;
10pub mod operators;
11pub mod parallel_query;
12
13pub use expr::evaluate_expr;
14pub use operators::{
15    FilterOperator, HashAggregateOperator, HashJoinOperator, LimitOperator, PhysicalOperator,
16    ProjectionOperator, SortOperator, TableScanOperator,
17};
18pub use parallel_query::{AggregateResult, AggregateType, ParallelQueryExecutor};
19
20// Helper function for concatenating RecordBatches
21pub fn concat_batches(schema: &Arc<Schema>, batches: &[RecordBatch]) -> DbxResult<RecordBatch> {
22    if batches.len() == 1 {
23        return Ok(batches[0].clone());
24    }
25    Ok(compute::concat_batches(schema, batches)?)
26}