Skip to main content

datafusion_expr/
lib.rs

1// Licensed to the Apache Software Foundation (ASF) under one
2// or more contributor license agreements.  See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership.  The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License.  You may obtain a copy of the License at
8//
9//   http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied.  See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
18#![doc(
19    html_logo_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg",
20    html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg"
21)]
22#![cfg_attr(docsrs, feature(doc_cfg))]
23// Make sure fast / cheap clones on Arc are explicit:
24// https://github.com/apache/datafusion/issues/11143
25#![deny(clippy::clone_on_ref_ptr)]
26#![cfg_attr(test, allow(clippy::needless_pass_by_value))]
27
28//! [DataFusion](https://github.com/apache/datafusion)
29//! is an extensible query execution framework that uses
30//! [Apache Arrow](https://arrow.apache.org) as its in-memory format.
31//!
32//! This crate is a submodule of DataFusion that provides types representing
33//! logical query plans ([LogicalPlan]) and logical expressions ([Expr]) as well as utilities for
34//! working with these types.
35//!
36//! The [expr_fn] module contains functions for creating expressions.
37
38extern crate core;
39
40mod higher_order_function;
41mod literal;
42mod operation;
43mod partition_evaluator;
44mod table_source;
45mod udaf;
46mod udf;
47mod udwf;
48
49pub mod arguments;
50pub mod conditional_expressions;
51pub mod execution_props;
52pub mod expr;
53pub mod expr_fn;
54pub mod expr_rewriter;
55pub mod expr_schema;
56pub mod extension_types;
57pub mod function;
58pub mod select_expr;
59pub mod groups_accumulator {
60    pub use datafusion_expr_common::groups_accumulator::*;
61}
62pub mod interval_arithmetic {
63    pub use datafusion_expr_common::interval_arithmetic::*;
64}
65pub mod logical_plan;
66pub mod dml {
67    //! DML (Data Manipulation Language) types for DELETE, UPDATE operations.
68    pub use crate::logical_plan::dml::*;
69}
70pub mod planner;
71pub mod registry;
72pub mod simplify;
73pub mod sort_properties {
74    pub use datafusion_expr_common::sort_properties::*;
75}
76pub mod async_udf;
77pub mod statistics {
78    pub use datafusion_expr_common::statistics::*;
79}
80mod predicate_bounds;
81pub mod preimage;
82pub mod ptr_eq;
83#[cfg(not(feature = "sql"))]
84pub mod sql;
85pub mod test;
86pub mod tree_node;
87pub mod type_coercion;
88pub mod udf_eq;
89pub mod utils;
90pub mod var_provider;
91pub mod window_frame;
92pub mod window_state;
93
94pub use datafusion_doc::{
95    DocSection, Documentation, DocumentationBuilder, aggregate_doc_sections,
96    scalar_doc_sections, window_doc_sections,
97};
98pub use datafusion_expr_common::accumulator::Accumulator;
99pub use datafusion_expr_common::columnar_value::ColumnarValue;
100pub use datafusion_expr_common::groups_accumulator::{EmitTo, GroupsAccumulator};
101pub use datafusion_expr_common::operator::Operator;
102pub use datafusion_expr_common::placement::ExpressionPlacement;
103pub use datafusion_expr_common::signature::{
104    ArrayFunctionArgument, ArrayFunctionSignature, Coercion, Signature,
105    TIMEZONE_WILDCARD, TypeSignature, TypeSignatureClass, Volatility,
106};
107pub use datafusion_expr_common::type_coercion::binary;
108pub use expr::{
109    Between, BinaryExpr, Case, Cast, Expr, GetFieldAccess, GroupingSet, Like,
110    Sort as SortExpr, TryCast, WindowFunctionDefinition,
111};
112pub use expr_fn::*;
113pub use expr_schema::ExprSchemable;
114pub use function::{
115    AccumulatorFactoryFunction, PartitionEvaluatorFactory, ReturnTypeFunction,
116    ScalarFunctionImplementation, StateTypeFunction,
117};
118pub use higher_order_function::{
119    HigherOrderFunctionArgs, HigherOrderReturnFieldArgs, HigherOrderSignature,
120    HigherOrderTypeSignature, HigherOrderUDF, HigherOrderUDFImpl, LambdaArgument,
121    LambdaParametersProgress, ValueOrLambda,
122};
123pub use literal::{
124    Literal, TimestampLiteral, lit, lit_timestamp_nano, lit_with_metadata,
125};
126pub use logical_plan::*;
127pub use partition_evaluator::PartitionEvaluator;
128#[cfg(feature = "sql")]
129pub use sqlparser;
130pub use table_source::{TableProviderFilterPushDown, TableSource, TableType};
131pub use udaf::{
132    AggregateUDF, AggregateUDFImpl, ReversedUDAF, SetMonotonicity, StatisticsArgs,
133    udaf_default_display_name, udaf_default_human_display, udaf_default_return_field,
134    udaf_default_schema_name, udaf_default_window_function_display_name,
135    udaf_default_window_function_schema_name,
136};
137pub use udf::{
138    ReturnFieldArgs, ScalarFunctionArgs, ScalarUDF, ScalarUDFImpl, StructFieldMapping,
139};
140pub use udwf::{LimitEffect, ReversedUDWF, WindowUDF, WindowUDFImpl};
141pub use window_frame::{WindowFrame, WindowFrameBound, WindowFrameUnits};
142
143#[cfg(test)]
144#[ctor::ctor(unsafe)]
145fn init() {
146    // Enable RUST_LOG logging configuration for test
147    let _ = env_logger::try_init();
148}