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