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 literal;
41mod operation;
42mod partition_evaluator;
43mod table_source;
44mod udaf;
45mod udf;
46mod udwf;
47
48pub mod arguments;
49pub mod conditional_expressions;
50pub mod execution_props;
51pub mod expr;
52pub mod expr_fn;
53pub mod expr_rewriter;
54pub mod expr_schema;
55pub mod function;
56pub mod select_expr;
57pub mod groups_accumulator {
58    pub use datafusion_expr_common::groups_accumulator::*;
59}
60pub mod interval_arithmetic {
61    pub use datafusion_expr_common::interval_arithmetic::*;
62}
63pub mod logical_plan;
64pub mod dml {
65    //! DML (Data Manipulation Language) types for DELETE, UPDATE operations.
66    pub use crate::logical_plan::dml::*;
67}
68pub mod planner;
69pub mod registry;
70pub mod simplify;
71pub mod sort_properties {
72    pub use datafusion_expr_common::sort_properties::*;
73}
74pub mod async_udf;
75pub mod statistics {
76    pub use datafusion_expr_common::statistics::*;
77}
78mod predicate_bounds;
79pub mod preimage;
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::placement::ExpressionPlacement;
99pub use datafusion_expr_common::signature::{
100    ArrayFunctionArgument, ArrayFunctionSignature, Coercion, Signature,
101    TIMEZONE_WILDCARD, TypeSignature, TypeSignatureClass, Volatility,
102};
103pub use datafusion_expr_common::type_coercion::binary;
104pub use expr::{
105    Between, BinaryExpr, Case, Cast, Expr, GetFieldAccess, GroupingSet, Like,
106    Sort as SortExpr, TryCast, WindowFunctionDefinition,
107};
108pub use expr_fn::*;
109pub use expr_schema::ExprSchemable;
110pub use function::{
111    AccumulatorFactoryFunction, PartitionEvaluatorFactory, ReturnTypeFunction,
112    ScalarFunctionImplementation, StateTypeFunction,
113};
114pub use literal::{
115    Literal, TimestampLiteral, lit, lit_timestamp_nano, lit_with_metadata,
116};
117pub use logical_plan::*;
118pub use partition_evaluator::PartitionEvaluator;
119#[cfg(feature = "sql")]
120pub use sqlparser;
121pub use table_source::{TableProviderFilterPushDown, TableSource, TableType};
122pub use udaf::{
123    AggregateUDF, AggregateUDFImpl, ReversedUDAF, SetMonotonicity, StatisticsArgs,
124    udaf_default_display_name, udaf_default_human_display, udaf_default_return_field,
125    udaf_default_schema_name, udaf_default_window_function_display_name,
126    udaf_default_window_function_schema_name,
127};
128pub use udf::{ReturnFieldArgs, ScalarFunctionArgs, ScalarUDF, ScalarUDFImpl};
129pub use udwf::{LimitEffect, ReversedUDWF, WindowUDF, WindowUDFImpl};
130pub use window_frame::{WindowFrame, WindowFrameBound, WindowFrameUnits};
131
132#[cfg(test)]
133#[ctor::ctor]
134fn init() {
135    // Enable RUST_LOG logging configuration for test
136    let _ = env_logger::try_init();
137}