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#![deny(clippy::allow_attributes)]
28
29//! [DataFusion](https://github.com/apache/datafusion)
30//! is an extensible query execution framework that uses
31//! [Apache Arrow](https://arrow.apache.org) as its in-memory format.
32//!
33//! This crate is a submodule of DataFusion that provides types representing
34//! logical query plans ([LogicalPlan]) and logical expressions ([Expr]) as well as utilities for
35//! working with these types.
36//!
37//! The [expr_fn] module contains functions for creating expressions.
38
39extern crate core;
40
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 function;
57pub mod select_expr;
58pub mod groups_accumulator {
59    pub use datafusion_expr_common::groups_accumulator::*;
60}
61pub mod interval_arithmetic {
62    pub use datafusion_expr_common::interval_arithmetic::*;
63}
64pub mod logical_plan;
65pub mod dml {
66    //! DML (Data Manipulation Language) types for DELETE, UPDATE operations.
67    pub use crate::logical_plan::dml::*;
68}
69pub mod planner;
70pub mod registry;
71pub mod simplify;
72pub mod sort_properties {
73    pub use datafusion_expr_common::sort_properties::*;
74}
75pub mod async_udf;
76pub mod statistics {
77    pub use datafusion_expr_common::statistics::*;
78}
79mod predicate_bounds;
80pub mod ptr_eq;
81pub mod test;
82pub mod tree_node;
83pub mod type_coercion;
84pub mod udf_eq;
85pub mod utils;
86pub mod var_provider;
87pub mod window_frame;
88pub mod window_state;
89
90pub use datafusion_doc::{
91    DocSection, Documentation, DocumentationBuilder, aggregate_doc_sections,
92    scalar_doc_sections, window_doc_sections,
93};
94pub use datafusion_expr_common::accumulator::Accumulator;
95pub use datafusion_expr_common::columnar_value::ColumnarValue;
96pub use datafusion_expr_common::groups_accumulator::{EmitTo, GroupsAccumulator};
97pub use datafusion_expr_common::operator::Operator;
98pub use datafusion_expr_common::signature::{
99    ArrayFunctionArgument, ArrayFunctionSignature, Coercion, Signature,
100    TIMEZONE_WILDCARD, TypeSignature, TypeSignatureClass, Volatility,
101};
102pub use datafusion_expr_common::type_coercion::binary;
103pub use expr::{
104    Between, BinaryExpr, Case, Cast, Expr, GetFieldAccess, GroupingSet, Like,
105    Sort as SortExpr, TryCast, WindowFunctionDefinition,
106};
107pub use expr_fn::*;
108pub use expr_schema::ExprSchemable;
109pub use function::{
110    AccumulatorFactoryFunction, PartitionEvaluatorFactory, ReturnTypeFunction,
111    ScalarFunctionImplementation, StateTypeFunction,
112};
113pub use literal::{
114    Literal, TimestampLiteral, lit, lit_timestamp_nano, lit_with_metadata,
115};
116pub use logical_plan::*;
117pub use partition_evaluator::PartitionEvaluator;
118#[cfg(feature = "sql")]
119pub use sqlparser;
120pub use table_source::{TableProviderFilterPushDown, TableSource, TableType};
121pub use udaf::{
122    AggregateUDF, AggregateUDFImpl, ReversedUDAF, SetMonotonicity, StatisticsArgs,
123    udaf_default_display_name, udaf_default_human_display, udaf_default_return_field,
124    udaf_default_schema_name, udaf_default_window_function_display_name,
125    udaf_default_window_function_schema_name,
126};
127pub use udf::{ReturnFieldArgs, ScalarFunctionArgs, ScalarUDF, ScalarUDFImpl};
128pub use udwf::{LimitEffect, ReversedUDWF, WindowUDF, WindowUDFImpl};
129pub use window_frame::{WindowFrame, WindowFrameBound, WindowFrameUnits};
130
131#[cfg(test)]
132#[ctor::ctor]
133fn init() {
134    // Enable RUST_LOG logging configuration for test
135    let _ = env_logger::try_init();
136}