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
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
37extern crate core;
38
39mod literal;
40mod operation;
41mod partition_evaluator;
42mod table_source;
43mod udaf;
44mod udf;
45mod udwf;
46
47pub mod arguments;
48pub mod conditional_expressions;
49pub mod execution_props;
50pub mod expr;
51pub mod expr_fn;
52pub mod expr_rewriter;
53pub mod expr_schema;
54pub mod function;
55pub mod select_expr;
56pub mod groups_accumulator {
57    pub use datafusion_expr_common::groups_accumulator::*;
58}
59pub mod interval_arithmetic {
60    pub use datafusion_expr_common::interval_arithmetic::*;
61}
62pub mod logical_plan;
63pub mod planner;
64pub mod registry;
65pub mod simplify;
66pub mod sort_properties {
67    pub use datafusion_expr_common::sort_properties::*;
68}
69pub mod async_udf;
70pub mod statistics {
71    pub use datafusion_expr_common::statistics::*;
72}
73pub mod ptr_eq;
74pub mod test;
75pub mod tree_node;
76pub mod type_coercion;
77pub mod udf_eq;
78pub mod utils;
79pub mod var_provider;
80pub mod window_frame;
81pub mod window_state;
82
83pub use datafusion_doc::{
84    aggregate_doc_sections, scalar_doc_sections, window_doc_sections, DocSection,
85    Documentation, DocumentationBuilder,
86};
87pub use datafusion_expr_common::accumulator::Accumulator;
88pub use datafusion_expr_common::columnar_value::ColumnarValue;
89pub use datafusion_expr_common::groups_accumulator::{EmitTo, GroupsAccumulator};
90pub use datafusion_expr_common::operator::Operator;
91pub use datafusion_expr_common::signature::{
92    ArrayFunctionArgument, ArrayFunctionSignature, Coercion, Signature, TypeSignature,
93    TypeSignatureClass, Volatility, TIMEZONE_WILDCARD,
94};
95pub use datafusion_expr_common::type_coercion::binary;
96pub use expr::{
97    Between, BinaryExpr, Case, Cast, Expr, GetFieldAccess, GroupingSet, Like,
98    Sort as SortExpr, TryCast, WindowFunctionDefinition,
99};
100pub use expr_fn::*;
101pub use expr_schema::ExprSchemable;
102pub use function::{
103    AccumulatorFactoryFunction, PartitionEvaluatorFactory, ReturnTypeFunction,
104    ScalarFunctionImplementation, StateTypeFunction,
105};
106pub use literal::{
107    lit, lit_timestamp_nano, lit_with_metadata, Literal, TimestampLiteral,
108};
109pub use logical_plan::*;
110pub use partition_evaluator::PartitionEvaluator;
111#[cfg(feature = "sql")]
112pub use sqlparser;
113pub use table_source::{TableProviderFilterPushDown, TableSource, TableType};
114pub use udaf::{
115    udaf_default_display_name, udaf_default_human_display, udaf_default_return_field,
116    udaf_default_schema_name, udaf_default_window_function_display_name,
117    udaf_default_window_function_schema_name, AggregateUDF, AggregateUDFImpl,
118    ReversedUDAF, SetMonotonicity, StatisticsArgs,
119};
120pub use udf::{ReturnFieldArgs, ScalarFunctionArgs, ScalarUDF, ScalarUDFImpl};
121pub use udwf::{LimitEffect, ReversedUDWF, WindowUDF, WindowUDFImpl};
122pub use window_frame::{WindowFrame, WindowFrameBound, WindowFrameUnits};
123
124#[cfg(test)]
125#[ctor::ctor]
126fn init() {
127    // Enable RUST_LOG logging configuration for test
128    let _ = env_logger::try_init();
129}