Expand description
DataFusion “prelude” to simplify importing common types.
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::SQLOptions;
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.
- Implementation of
ExprFunctionExt
. - Configuration options for
SessionContext
. - Implements
AggregateUDFImpl
for functions that have a single signature and return type. - Implements
ScalarUDFImpl
for functions that have a single signature and return type. - Implements
WindowUDFImpl
for functions that have a single signature and return type.
Enums§
- Represents logical expressions such as
A + 1
, orCAST(c1 AS int)
. - Join type
- Logical partitioning schemes supported by
LogicalPlan::Repartition
Traits§
- The addition operator
+
. - The bitwise AND operator
&
. - The bitwise OR operator
|
. - The bitwise XOR operator
^
. - The division operator
/
. - Extensions for configuring
Expr::AggregateFunction
orExpr::WindowFunction
- The multiplication operator
*
. - The unary negation operator
-
. - The unary logical negation operator
!
. - The remainder operator
%
. - The left shift operator
<<
. Note that because this trait is implemented for all integer types with multiple right-hand-side types, Rust’s type checker has special handling for_ << _
, setting the result type for integer operations to the type of the left-hand-side operand. This means that thougha << b
anda.shl(b)
are one and the same from an evaluation standpoint, they are different when it comes to type inference. - The right shift operator
>>
. Note that because this trait is implemented for all integer types with multiple right-hand-side types, Rust’s type checker has special handling for_ >> _
, setting the result type for integer operations to the type of the left-hand-side operand. This means that thougha >> b
anda.shr(b)
are one and the same from an evaluation standpoint, they are different when it comes to type inference. - The subtraction operator
-
.
Functions§
- returns the absolute value of a given number
- returns the arc cosine or inverse cosine of a number
- returns inverse hyperbolic cosine
- Return a new expression with a logical AND
- returns the first non-null element in the array.
- appends an element to the end of an array.
- Concatenates arrays.
- returns an array of the array’s dimensions.
- returns the Euclidean distance between two numeric arrays.
- returns distinct values from the array after removing duplicates.
- extracts the element with the index n from the array.
- returns true for an empty array or false for a non-empty array.
- returns an array of the elements that appear in the first array but not in the second.
- returns true, if the element appears in the first array, otherwise false.
- returns true if each element of the second array appears in the first array; otherwise, it returns false.
- returns true if at least one element of the second array appears in the first array; otherwise, it returns false.
- returns an array of the elements in the intersection of array1 and array2.
- returns the length of the array dimension.
- returns the number of dimensions of the array.
- returns the array without the last element.
- returns the array without the first element.
- searches for an element in the array, returns first occurrence.
- searches for an element in the array, returns all occurrences.
- Prepends an element to the beginning of an array.
- removes the first element from the array equal to the given value.
- removes all elements from the array equal to the given value.
- removes the first
max
elements from the array equal to the given value. - returns an array containing element
count
times. - replaces the first occurrence of the specified element with another specified element.
- replaces all occurrences of the specified element with another specified element.
- replaces the first
max
occurrences of the specified element with another specified element. - returns an array with the specified size filled with the given value.
- reverses the order of elements in the array.
- returns a slice of the array.
- returns sorted array.
- converts each element to its text representation.
- returns an array of the elements in the union of array1 and array2 without duplicates.
- Returns value2 if value1 is NULL; otherwise it returns value1
- Returns the Arrow type of the input expression.
- Returns the numeric code of the first character of the argument.
- returns the arc sine or inverse sine of a number
- returns inverse hyperbolic sine
- returns inverse tangent
- returns inverse tangent of a division given in the argument
- returns inverse hyperbolic tangent
- Return a new expression
left <op> right
- Returns the number of bits in the
string
- Return a new expression with bitwise AND
- Return a new expression with bitwise OR
- Return a new expression with bitwise SHIFT LEFT
- Return a new expression with bitwise SHIFT RIGHT
- Return a new expression with bitwise XOR
- Removes all characters, spaces by default, from both sides of a string
- returns the total number of elements in the array or map.
- Create a CASE WHEN statement with literal WHEN expressions for comparison to the base expression.
- Create a cast expression
- cube root of a number
- nearest integer greater than or equal to argument
- the number of characters in the
string
- the number of characters in the
string
- Converts the Unicode code point to a UTF8 character
- 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. Will normalize unquoted identifiers according to SQL rules (identifiers will become lowercase).
- Concatenates the text representations of all the arguments. NULL arguments are ignored
- 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.
- Return true if search_string is found within string.
- cosine
- hyperbolic cosine
- cotangent of a number
- Creates a new UDAF with a specific signature, state type and return type. The signature and state type must match the
Accumulator's implementation
. - Convenience method to create a new user defined scalar function (UDF) with a specific signature and specific return type.
- Creates a new UDWF with a specific signature, state type and return type.
- Create a grouping set for all combination of
exprs
- returns current UTC date as a Date32 value
- returns current UTC time as a Time64 value
- coerces an arbitrary timestamp to the start of the nearest specified interval
- extracts a subfield from the date
- truncates the date to a specified level of precision
- decode the
input
, using theencoding
. encoding can be base64 or hex - converts radians to degrees
- Computes the binary hash of an expression using the specified algorithm.
- encode the
input
, using theencoding
. encoding can be base64 or hex - Returns true if the
string
ends with thesuffix
, false otherwise. - Create an EXISTS subquery expression
- exponential
- factorial
- Returns a value in the range of 1 to N if the string str is in the string list strlist consisting of N substrings
- flattens an array of arrays into a single array.
- nearest integer less than or equal to argument
- converts an integer to RFC3339 timestamp format string
- greatest common divisor
- create a list of values in the range between start and stop, include upper bound
- Returns the value of the field with the given name from the struct
- Returns
greatest(args...)
, which evaluates to the greatest value in the list of expressions or NULL if all the expressions are NULL - Create a grouping set
- Create an unqualified column expression from the provided name, without normalizing the column.
- Create an in_list expression
- Create an IN subquery expression
- converts the first letter of each word in
string
in uppercase and the remaining characters in lowercase - finds the position from where the
substring
matches thestring
- 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
- returns true if a given number is +NaN or -NaN otherwise returns false
- returns true if a given number is +0.0 or -0.0 otherwise returns false
- least common multiple
- Returns
least(args...)
, which evaluates to the smallest value in the list of expressions or NULL if all the expressions are NULL - returns the first
n
characters in thestring
- the number of characters in the
string
- Returns the Levenshtein distance between the two given strings
- Create a literal expression
- Create a literal timestamp expression
- natural logarithm (base e) of a number
- logarithm of a number for a particular
base
- base 2 logarithm of a number
- base 10 logarithm of a number
- Converts a string to lowercase.
- fill up a string to the length by prepending the characters
- Removes all characters, spaces by default, from the beginning of a string
- Returns an Arrow array using the specified input expressions.
- make a date from year, month and day component parts
- Return a list containing the value for a given key or an empty list if the key is not contained in the map.
- Return a list of all keys in the map.
- Return a list of all values in the map.
- Computes an MD5 128-bit checksum for a string expression.
- Returns a struct with the given names and arguments pairs
- returns x if x is not NaN otherwise returns y
- Return a new expression with a logical NOT
- Create a NOT EXISTS subquery expression
- Create a NOT IN subquery expression
- returns the current timestamp in nanoseconds, using the same value for all instances of now() in same statement
- Returns NULL if value1 equals value2; otherwise it returns value1. This can be used to perform the inverse operation of the COALESCE expression
- Returns value2 if value1 is NULL; otherwise it returns value1
- Returns value2 if value1 is not NULL; otherwise, it returns value3.
- returns the number of bytes of a string
- Return a new expression with a logical OR
- Create an out reference column which hold a reference that has been resolved to a field outside of the current plan.
- replace the substring of string that starts at the start’th character and extends for count characters with new substring
- Returns an approximate value of π
- Create placeholder value that will be filled in (such as
$1
) - finds the position from where the
substring
matches thestring
base
raised to the power ofexponent
- Create an ‘t.*’
Expr::Wildcard
expression that matches all columns from a specific table - Create an ‘t.*’
Expr::Wildcard
expression with the wildcard options - converts degrees to radians
- Returns a random value in the range 0.0 <= x < 1.0
- create a list of values in the range between start and stop
- Returns the number of consecutive occurrences of a regular expression in a string.
- Returns true if a has at least one match in a string, false otherwise.
- Returns a list of regular expression matches in a string.
- Replaces substrings in a string that match.
- Repeats the
string
ton
times - Replaces all occurrences of
from
withto
in thestring
- reverses the
string
- returns the last
n
characters in thestring
- Create a grouping set for rollup
- round to nearest integer
- fill up a string to the length by appending the characters
- Removes all characters, spaces by default, from the end of a string
- Create a scalar subquery expression
- Computes the SHA-224 hash of a binary string.
- Computes the SHA-256 hash of a binary string.
- Computes the SHA-384 hash of a binary string.
- Computes the SHA-512 hash of a binary string.
- sign of the argument (-1, 0, +1)
- sine
- hyperbolic sine
- Splits a string based on a delimiter and picks out the desired field based on the index.
- square root of a number
- Returns true if string starts with prefix.
- splits a
string
based on adelimiter
and returns an array of parts. Any parts matching the optionalnull_string
will be replaced withNULL
- finds the position from where the
substring
matches thestring
- Returns a struct with the given arguments
- substring from the
position
to the end - Returns the substring from str before count occurrences of the delimiter
- substring from the
position
withlength
characters - returns the tangent of a number
- returns the hyperbolic tangent of a number
- Returns a string representation of a date, time, timestamp or duration based on a Chrono pattern.
- Converts an integer to a hexadecimal string.
- converts a timezone-aware timestamp to local time (with no offset or timezone information), i.e. strips off the timezone from the timestamp
- converts a string and optional formats to a
Timestamp(Nanoseconds, None)
- converts a string and optional formats to a
Timestamp(Microseconds, None)
- converts a string and optional formats to a
Timestamp(Milliseconds, None)
- converts a string and optional formats to a
Timestamp(Nanoseconds, None)
- converts a string and optional formats to a
Timestamp(Seconds, None)
- converts a string and optional formats to a Unixtime
- replaces the characters in
from
with the counterpart into
- Removes all characters, spaces by default, from both sides of a string
- truncate toward zero, with optional precision
- Create a try cast expression
- Create a Unnest expression
- Converts a string to uppercase.
- returns uuid v4 as a string value
- Create a CASE WHEN statement with boolean WHEN expressions and no base expression.
- Create an ‘*’
Expr::Wildcard
expression that matches all columns - Create an ‘*’
Expr::Wildcard
expression with the wildcard options