use crate::arrow::record_batch::RecordBatch;
use crate::error::Result;
use crate::execution::context::ExecutionContext;
use crate::logicalplan::{Expr, LogicalPlan};
use arrow::datatypes::Schema;
use std::sync::Arc;
pub trait Table {
fn select_columns(&self, columns: Vec<&str>) -> Result<Arc<dyn Table>>;
fn select(&self, expr: Vec<Expr>) -> Result<Arc<dyn Table>>;
fn filter(&self, expr: Expr) -> Result<Arc<dyn Table>>;
fn aggregate(
&self,
group_expr: Vec<Expr>,
aggr_expr: Vec<Expr>,
) -> Result<Arc<dyn Table>>;
fn limit(&self, n: usize) -> Result<Arc<dyn Table>>;
fn to_logical_plan(&self) -> LogicalPlan;
fn col(&self, name: &str) -> Result<Expr>;
fn min(&self, expr: &Expr) -> Result<Expr>;
fn max(&self, expr: &Expr) -> Result<Expr>;
fn sum(&self, expr: &Expr) -> Result<Expr>;
fn avg(&self, expr: &Expr) -> Result<Expr>;
fn count(&self, expr: &Expr) -> Result<Expr>;
fn collect(
&self,
ctx: &mut ExecutionContext,
batch_size: usize,
) -> Result<Vec<RecordBatch>>;
fn schema(&self) -> &Schema;
}