Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
run: cargo fmt --all -- --check

- name: Clippy
run: cargo clippy --all-targets --workspace --features fulltext,vortex -- -D warnings
run: cargo clippy --all-targets --workspace --features fulltext,vortex,mosaic -- -D warnings

build:
runs-on: ${{ matrix.os }}
Expand All @@ -71,7 +71,7 @@ jobs:
steps:
- uses: actions/checkout@v6
- name: Build
run: cargo build --features fulltext,vortex
run: cargo build --features fulltext,vortex,mosaic

unit:
runs-on: ${{ matrix.os }}
Expand All @@ -85,7 +85,7 @@ jobs:
- uses: actions/checkout@v6

- name: Test
run: cargo test -p paimon --all-targets --features fulltext,vortex
run: cargo test -p paimon --all-targets --features fulltext,vortex,mosaic
env:
RUST_LOG: DEBUG
RUST_BACKTRACE: full
Expand Down
1 change: 1 addition & 0 deletions crates/integrations/datafusion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ keywords = ["paimon", "datafusion", "integrations"]

[features]
fulltext = ["paimon/fulltext"]
mosaic = ["paimon/mosaic"]
vortex = ["paimon/vortex"]

[dependencies]
Expand Down
2 changes: 2 additions & 0 deletions crates/paimon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ storage-all = [
"storage-hdfs",
]
fulltext = ["tantivy", "tempfile"]
mosaic = ["dep:paimon-mosaic-core"]
vortex = ["dep:vortex", "dep:kanal"]

storage-memory = ["opendal/services-memory"]
Expand Down Expand Up @@ -101,6 +102,7 @@ uuid = { version = "1", features = ["v4"] }
urlencoding = "2.1"
tantivy = { version = "0.22", optional = true }
tempfile = { version = "3", optional = true }
paimon-mosaic-core = { version = "0.1.0", optional = true }
vortex = { version = "0.68", features = ["tokio"], optional = true }
kanal = { version = "0.1.1", optional = true }
libloading = "0.9"
Expand Down
22 changes: 21 additions & 1 deletion crates/paimon/src/arrow/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

mod avro;
pub(crate) mod blob;
#[cfg(feature = "mosaic")]
mod mosaic;
mod orc;
mod parquet;
#[cfg(feature = "vortex")]
Expand Down Expand Up @@ -105,18 +107,36 @@ pub(crate) fn create_format_reader(
} else if lower.ends_with(".avro") {
Ok(Box::new(avro::AvroFormatReader))
} else {
#[cfg(feature = "mosaic")]
if lower.ends_with(".mosaic") {
return Ok(Box::new(mosaic::MosaicFormatReader));
}
#[cfg(feature = "vortex")]
if lower.ends_with(".vortex") {
return Ok(Box::new(vortex::VortexFormatReader));
}
Err(Error::Unsupported {
message: format!(
"unsupported file format: expected .parquet, .blob, .orc, or .avro, got: {path}"
"unsupported file format: expected {}, got: {path}",
supported_read_formats().join(", ")
),
})
}
}

fn supported_read_formats() -> Vec<&'static str> {
vec![
".parquet",
".blob",
".orc",
".avro",
#[cfg(feature = "mosaic")]
".mosaic",
#[cfg(feature = "vortex")]
".vortex",
]
}

/// Create a format writer that streams directly to storage.
pub(crate) async fn create_format_writer(
output: &OutputFile,
Expand Down
Loading
Loading