[][src]Struct datafusion::execution::context::ExecutionContext

pub struct ExecutionContext { /* fields omitted */ }

Execution context for registering data sources and executing queries

Implementations

impl ExecutionContext[src]

pub fn new() -> Self[src]

Create a new execution context for in-memory queries

pub fn sql(&mut self, sql: &str, batch_size: usize) -> Result<Vec<RecordBatch>>[src]

Execute a SQL query and produce a Relation (a schema-aware iterator over a series of RecordBatch instances)

pub fn collect_plan(
    &mut self,
    plan: &LogicalPlan,
    batch_size: usize
) -> Result<Vec<RecordBatch>>
[src]

Executes a logical plan and produce a Relation (a schema-aware iterator over a series of RecordBatch instances)

pub fn create_logical_plan(&mut self, sql: &str) -> Result<LogicalPlan>[src]

Creates a logical plan

pub fn register_udf(&mut self, f: ScalarFunction)[src]

Register a scalar UDF

pub fn scalar_functions(&self) -> &HashMap<String, Box<ScalarFunction>>[src]

Get a reference to the registered scalar functions

pub fn register_csv(
    &mut self,
    name: &str,
    filename: &str,
    options: CsvReadOptions
) -> Result<()>
[src]

Register a CSV file as a table so that it can be queried from SQL

pub fn register_parquet(&mut self, name: &str, filename: &str) -> Result<()>[src]

Register a Parquet file as a table so that it can be queried from SQL

pub fn register_table(
    &mut self,
    name: &str,
    provider: Box<dyn TableProvider + Send + Sync>
)
[src]

Register a table so that it can be queried from SQL

pub fn table(&mut self, table_name: &str) -> Result<Arc<dyn Table>>[src]

Get a table by name

pub fn tables(&self) -> HashSet<String>[src]

The set of available tables. Use table to get a specific table.

pub fn optimize(&self, plan: &LogicalPlan) -> Result<LogicalPlan>[src]

Optimize the logical plan by applying optimizer rules

pub fn create_physical_plan(
    &self,
    logical_plan: &LogicalPlan,
    batch_size: usize
) -> Result<Arc<dyn ExecutionPlan>>
[src]

Create a physical plan from a logical plan

pub fn create_physical_expr(
    &self,
    e: &Expr,
    input_schema: &Schema
) -> Result<Arc<dyn PhysicalExpr>>
[src]

Create a physical expression from a logical expression

pub fn create_aggregate_expr(
    &self,
    e: &Expr,
    input_schema: &Schema
) -> Result<Arc<dyn AggregateExpr>>
[src]

Create an aggregate expression from a logical expression

pub fn create_physical_sort_expr(
    &self,
    e: &Expr,
    input_schema: &Schema,
    options: SortOptions
) -> Result<PhysicalSortExpr>
[src]

Create an aggregate expression from a logical expression

pub fn collect(&self, plan: &dyn ExecutionPlan) -> Result<Vec<RecordBatch>>[src]

Execute a physical plan and collect the results in memory

pub fn write_csv(&self, plan: &dyn ExecutionPlan, path: &str) -> Result<()>[src]

Execute a query and write the results to a partitioned CSV file

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoRequest<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]