[−][src]Struct datafusion::execution::context::ExecutionContext
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]
&mut self,
plan: &LogicalPlan,
batch_size: usize
) -> Result<Vec<RecordBatch>>
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]
&mut self,
name: &str,
filename: &str,
options: CsvReadOptions
) -> Result<()>
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]
&mut self,
name: &str,
provider: Box<dyn TableProvider + Send + Sync>
)
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]
&self,
logical_plan: &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 create_physical_sort_expr(
&self,
e: &Expr,
input_schema: &Schema,
options: SortOptions
) -> Result<PhysicalSortExpr>
[src]
&self,
e: &Expr,
input_schema: &Schema,
options: SortOptions
) -> Result<PhysicalSortExpr>
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> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoRequest<T> for T
[src]
fn into_request(self) -> Request<T>
[src]
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,