|
| 1 | +<!-- |
| 2 | +Licensed to the Apache Software Foundation (ASF) under one |
| 3 | +or more contributor license agreements. See the NOTICE file |
| 4 | +distributed with this work for additional information |
| 5 | +regarding copyright ownership. The ASF licenses this file |
| 6 | +to you under the Apache License, Version 2.0 (the |
| 7 | +"License"); you may not use this file except in compliance |
| 8 | +with the License. You may obtain a copy of the License at |
| 9 | +
|
| 10 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +
|
| 12 | +Unless required by applicable law or agreed to in writing, |
| 13 | +software distributed under the License is distributed on an |
| 14 | +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | +KIND, either express or implied. See the License for the |
| 16 | +specific language governing permissions and limitations |
| 17 | +under the License. |
| 18 | +--> |
| 19 | + |
| 20 | +# Architecture |
| 21 | + |
| 22 | +## Overview |
| 23 | + |
| 24 | +Apache Paimon Rust is organized as a Cargo workspace with multiple crates, each responsible for a distinct layer of functionality. |
| 25 | + |
| 26 | +## Crate Structure |
| 27 | + |
| 28 | +### `crates/paimon` — Core Library |
| 29 | + |
| 30 | +The core crate implements the Paimon table format, including: |
| 31 | + |
| 32 | +- **Catalog** — Catalog client for discovering and managing databases and tables |
| 33 | +- **Table** — Table abstraction for reading Paimon tables |
| 34 | +- **Snapshot & Manifest** — Reading snapshot and manifest metadata |
| 35 | +- **Schema** — Table schema management and evolution |
| 36 | +- **File IO** — Abstraction layer for storage backends (local filesystem, S3) |
| 37 | +- **File Format** — Parquet file reading and writing via Apache Arrow |
| 38 | + |
| 39 | +### `crates/integrations/datafusion` — DataFusion Integration |
| 40 | + |
| 41 | +Provides a `TableProvider` implementation that allows querying Paimon tables using [Apache DataFusion](https://datafusion.apache.org/)'s SQL engine. |
| 42 | + |
| 43 | +## Data Model |
| 44 | + |
| 45 | +Paimon organizes data in a layered structure: |
| 46 | + |
| 47 | +``` |
| 48 | +Catalog |
| 49 | + └── Database |
| 50 | + └── Table |
| 51 | + ├── Schema |
| 52 | + └── Snapshot |
| 53 | + └── Manifest |
| 54 | + └── Data Files (Parquet) |
| 55 | +``` |
| 56 | + |
| 57 | +- **Catalog** manages databases and tables, accessed via REST API |
| 58 | +- **Snapshot** represents a consistent view of a table at a point in time |
| 59 | +- **Manifest** lists the data files that belong to a snapshot |
| 60 | +- **Data Files** store the actual data in Parquet format |
0 commit comments