paimon_datafusion/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//! Apache Paimon DataFusion Integration.
19//!
20//! Register a Paimon table as a DataFusion table provider to query it with SQL or DataFrame API.
21//!
22//! # Example
23//!
24//! ```ignore
25//! use std::sync::Arc;
26//! use datafusion::prelude::SessionContext;
27//! use paimon_datafusion::PaimonTableProvider;
28//!
29//! // Obtain a Paimon Table (e.g. from your catalog), then:
30//! let provider = PaimonTableProvider::try_new(table)?;
31//! let ctx = SessionContext::new();
32//! ctx.register_table("my_table", Arc::new(provider))?;
33//! let df = ctx.sql("SELECT * FROM my_table").await?;
34//! ```
35//!
36//! This version supports partition predicate pushdown by extracting
37//! translatable partition-only conjuncts from DataFusion filters.
38
39mod catalog;
40mod error;
41mod filter_pushdown;
42#[cfg(feature = "fulltext")]
43mod full_text_search;
44mod merge_into;
45mod physical_plan;
46mod relation_planner;
47pub mod runtime;
48mod sql_handler;
49mod system_tables;
50mod table;
51mod update;
52
53pub use catalog::{PaimonCatalogProvider, PaimonSchemaProvider};
54pub use error::to_datafusion_error;
55#[cfg(feature = "fulltext")]
56pub use full_text_search::{register_full_text_search, FullTextSearchFunction};
57pub use physical_plan::PaimonTableScan;
58pub use relation_planner::PaimonRelationPlanner;
59pub use sql_handler::PaimonSqlHandler;
60pub use table::PaimonTableProvider;