Expand description

A “prelude” for users of the datafusion crate.

Like the standard library’s prelude, this module simplifies importing of common items. Unlike the standard prelude, the contents of this module must be imported manually:

use datafusion::prelude::*;

Re-exports

pub use crate::dataframe::DataFrame;
pub use crate::execution::context::SessionConfig;
pub use crate::execution::context::SessionContext;
pub use crate::execution::options::AvroReadOptions;
pub use crate::execution::options::CsvReadOptions;
pub use crate::execution::options::NdJsonReadOptions;
pub use crate::execution::options::ParquetReadOptions;

Structs

A named reference to a qualified field in a schema.

Enums

Expr is a central struct of DataFusion’s query API, and represent logical expressions such as A + 1, or CAST(c1 AS int).
Join type
Logical partitioning schemes supported by the repartition operator.

Functions

absolute value
inverse cosine
Return a new expression with a logical AND
Returns the approximate number of distinct input values. This function provides an approximation of count(DISTINCT x). Zero is returned if all input values are null. This function should produce a standard error of 0.81%, which is the standard deviation of the (approximately normal) error distribution over all possible sets. It does not guarantee an upper bound on the error for any specific input set.
Calculate an approximation of the median for expr.
Calculate an approximation of the specified percentile for expr.
Calculate an approximation of the specified percentile for expr and weight_expr.
Returns an array of fixed size with each argument on it.
data type
Scalar function definition for ascii
inverse sine
inverse tangent
Scalar function definition for atan2
Create an expression to represent the avg() aggregate function
Return a new expression l r
Scalar function definition for bit_length
Scalar function definition for btrim
Calls a named built in function
Create a CASE WHEN statement with literal WHEN expressions for comparison to the base expression.
Create a cast expression
nearest integer greater than or equal to argument
Scalar function definition for character_length
Scalar function definition for chr
Returns coalesce(args...), which evaluates to the value of the first Expr which is not NULL
Create a column expression based on a qualified or unqualified column name
Combines an array of filter expressions into a single filter expression consisting of the input filter expressions joined with logical AND. Returns None if the filters array is empty.
Combines an array of filter expressions into a single filter expression consisting of the input filter expressions joined with logical OR. Returns None if the filters array is empty.
Concatenates the text representations of all the arguments. NULL arguments are ignored.
Scalar function definition for concat_expr
Concatenates all but the first argument, with separators. The first argument is used as the separator string, and should not be NULL. Other NULL arguments are ignored.
Scalar function definition for concat_ws_expr
cosine
Create an expression to represent the count() aggregate function
Create an expression to represent the count(distinct) aggregate function
Creates a new UDAF with a specific signature, state type and return type. The signature and state type must match the Accumulator's implementation.
Creates a new UDF with a specific signature and specific return type. This is a helper function to create a new UDF. The function create_udf returns a subset of all possible ScalarFunction:
Create a grouping set for all combination of exprs
Scalar function definition for date_bin
Scalar function definition for date_part
Scalar function definition for date_trunc
Scalar function definition for digest
Create an EXISTS subquery expression
base 2 logarithm
nearest integer less than or equal to argument
Scalar function definition for from_unixtime
Create a grouping set
Create an in_list expression
Create an IN subquery expression
Scalar function definition for initcap
Create is false expression
Create is not false expression
Create is not true expression
Create is not unknown expression
Create is null expression
Create is true expression
Create is unknown expression
Scalar function definition for left
Scalar function definition for length
Create a literal expression
natural logarithm
base 10 logarithm
base 10 logarithm
Scalar function definition for lower
Scalar function definition for lpad
Scalar function definition for ltrim
Create an expression to represent the max() aggregate function
Scalar function definition for md5
Create an expression to represent the min() aggregate function
Create a NOT EXISTS subquery expression
Create a NOT IN subquery expression
Returns current timestamp in nanoseconds, using the same value for all instances of now() in same statement.
Scalar function definition for nullif
Scalar function definition for octet_length
Return a new expression with a logical OR
Scalar function definition for power
Returns a random value in the range 0.0 <= x < 1.0
Scalar function definition for regexp_match
Scalar function definition for regexp_replace
Scalar function definition for repeat
Scalar function definition for replace
Scalar function definition for reverse
Scalar function definition for right
Create a grouping set for rollup
round to nearest integer
Scalar function definition for rpad
Scalar function definition for rtrim
Create a scalar subquery expression
Scalar function definition for sha224
Scalar function definition for sha256
Scalar function definition for sha384
Scalar function definition for sha512
sign of the argument (-1, 0, +1)
sine
Scalar function definition for split_part
square root of a number
Scalar function definition for starts_with
Scalar function definition for strpos
Scalar function definition for substr
Create an expression to represent the sum() aggregate function
tangent
Scalar function definition for to_hex
Scalar function definition for to_timestamp_micros
Scalar function definition for to_timestamp_millis
Scalar function definition for to_timestamp_seconds
Scalar function definition for translate
Scalar function definition for trim
truncate toward zero
Create a try cast expression
Recursively un-alias an expressions
Take combined filter (multiple boolean expressions ANDed together) and break down into distinct filters. This should be the inverse of combine_filters
Scalar function definition for upper
Create a CASE WHEN statement with boolean WHEN expressions and no base expression.