[−][src]Struct datafusion::execution::context::ExecutionContext
Execution context for registering data sources and executing queries
Methods
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 create_logical_plan(&mut self, sql: &str) -> Result<Arc<LogicalPlan>>
[src]
Creates a logical plan
pub fn register_csv(
&mut self,
name: &str,
filename: &str,
schema: &Schema,
has_header: bool
)
[src]
&mut self,
name: &str,
filename: &str,
schema: &Schema,
has_header: bool
)
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>)
[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 optimize(&self, plan: &LogicalPlan) -> Result<Arc<LogicalPlan>>
[src]
Optimize the logical plan by applying optimizer rules
pub fn create_physical_plan(
&mut self,
logical_plan: &Arc<LogicalPlan>,
batch_size: usize
) -> Result<Arc<dyn ExecutionPlan>>
[src]
&mut self,
logical_plan: &Arc<LogicalPlan>,
batch_size: usize
) -> Result<Arc<dyn ExecutionPlan>>
Create a physical plan from a logical plan
pub fn create_physical_expr(
&self,
e: &Expr,
input_schema: &Schema
) -> Result<Arc<dyn PhysicalExpr>>
[src]
&self,
e: &Expr,
input_schema: &Schema
) -> Result<Arc<dyn PhysicalExpr>>
Create a physical expression from a logical expression
pub fn create_aggregate_expr(
&self,
e: &Expr,
input_schema: &Schema
) -> Result<Arc<dyn AggregateExpr>>
[src]
&self,
e: &Expr,
input_schema: &Schema
) -> Result<Arc<dyn AggregateExpr>>
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
impl !RefUnwindSafe for ExecutionContext
impl !Send for ExecutionContext
impl !Sync for ExecutionContext
impl Unpin for ExecutionContext
impl !UnwindSafe for ExecutionContext
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> Cast<U> for T where
U: FromCast<T>,
U: FromCast<T>,
fn cast(self) -> U
impl<T> From<T> for T
[src]
impl<T> FromCast<T> for T
fn from_cast(t: T) -> T
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,