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