Expand description

DataFusion is an extensible query execution framework that uses Apache Arrow as its in-memory format.

This crate is a submodule of DataFusion that provides types representing logical query plans (LogicalPlan) and logical expressions (Expr) as well as utilities for working with these types.

The expr_fn module contains functions for creating expressions.

Re-exports

pub use aggregate_function::AggregateFunction;
pub use expr::Expr;
pub use expr_fn::*;
pub use expr_schema::ExprSchemable;
pub use function::ReturnTypeFunction;
pub use function::ScalarFunctionImplementation;
pub use function::StateTypeFunction;
pub use logical_plan::LogicalPlanBuilder;
pub use window_frame::WindowFrame;
pub use window_frame::WindowFrameBound;
pub use window_frame::WindowFrameUnits;
pub use window_function::BuiltInWindowFunction;
pub use window_function::WindowFunction;

Modules

Aggregate function module contains all built-in aggregate functions definitions

Coercion rules for matching argument types for binary operators

Expr module contains core type definition for Expr.

Functions for creating logical expressions

Expression rewriter

Expression visitor

Utility functions for complex field access

Function module contains typing and signature for built-in and user defined functions.

Type coercion rules for functions with multiple valid signatures

Expression utilities

Window frame module

Window functions provide the ability to perform calculations across sets of rows that are related to the current query row.

Structs

Logical representation of a user-defined aggregate function (UDAF) A UDAF is different from a UDF in that it is stateful across batches.

Logical representation of a UDF.

The Signature of a function defines its supported input types as well as its volatility.

Enums

Enum of all built-in scalar functions

Represents the result from an expression

A LogicalPlan represents the different types of relational operators (such as Projection, Filter, etc) and can be created by the SQL query planner and the DataFrame API.

Operators applied to expressions

! Table source Indicates whether and how a filter expression can be handled by a TableProvider for table scans.

Indicates the type of this table for metadata/catalog purposes.

A function’s type signature, which defines the function’s supported argument types.

A function’s volatility, which defines the functions eligibility for certain optimizations

Statics

Currently supported types by the nullif function. The order of these types correspond to the order on which coercion applies This should thus be from least informative to most informative

Traits

An accumulator represents a stateful object that lives throughout the evaluation of multiple rows and generically accumulates values.

Trait for converting a type to a Literal literal expression.

Trait that implements the Visitor pattern for a depth first walk of LogicalPlan nodes. pre_visit is called before any children are visited, and then post_visit is called after all children have been visited. To use, define a struct that implements this trait and then invoke LogicalPlan::accept.

The TableSource trait is used during logical query planning and optimizations and provides access to schema information and filter push-down capabilities. This trait provides a subset of the functionality of the TableProvider trait in the core datafusion crate. The TableProvider trait provides additional capabilities needed for physical query execution (such as the ability to perform a scan). The reason for having two separate traits is to avoid having the logical plan code be dependent on the DataFusion execution engine. Other projects may want to use DataFusion’s logical plans and have their own execution engine.

Trait for converting a type to a literal timestamp

Functions

Create a literal expression

Create a literal timestamp expression

Type Definitions

null columnar values are implemented as a null array in order to pass batch num_rows