From 88ad671f91d5e72e14e2d05bd5fd3a3790c8f014 Mon Sep 17 00:00:00 2001 From: Farooq Qaiser Date: Fri, 13 Dec 2024 03:54:16 -0500 Subject: [PATCH] refactor: Move puffin crate contents inside iceberg crate (#789) --- Cargo.toml | 1 - crates/iceberg/Cargo.toml | 1 + crates/iceberg/src/lib.rs | 2 ++ .../src => iceberg/src/puffin}/compression.rs | 4 +-- .../src/lib.rs => iceberg/src/puffin/mod.rs} | 1 - crates/puffin/Cargo.toml | 36 ------------------- 6 files changed, 5 insertions(+), 40 deletions(-) rename crates/{puffin/src => iceberg/src/puffin}/compression.rs (97%) rename crates/{puffin/src/lib.rs => iceberg/src/puffin/mod.rs} (96%) delete mode 100644 crates/puffin/Cargo.toml diff --git a/Cargo.toml b/Cargo.toml index 296cb5d42..9a76ff416 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,6 @@ members = [ "crates/iceberg", "crates/integration_tests", "crates/integrations/*", - "crates/puffin", "crates/test_utils", ] exclude = ["bindings/python"] diff --git a/crates/iceberg/Cargo.toml b/crates/iceberg/Cargo.toml index 1307cc6f3..f2e6694bc 100644 --- a/crates/iceberg/Cargo.toml +++ b/crates/iceberg/Cargo.toml @@ -81,6 +81,7 @@ tokio = { workspace = true, optional = true } typed-builder = { workspace = true } url = { workspace = true } uuid = { workspace = true } +zstd = { workspace = true } [dev-dependencies] ctor = { workspace = true } diff --git a/crates/iceberg/src/lib.rs b/crates/iceberg/src/lib.rs index 72cf18d4b..eaecfea60 100644 --- a/crates/iceberg/src/lib.rs +++ b/crates/iceberg/src/lib.rs @@ -84,3 +84,5 @@ mod runtime; pub mod arrow; mod utils; pub mod writer; + +mod puffin; diff --git a/crates/puffin/src/compression.rs b/crates/iceberg/src/puffin/compression.rs similarity index 97% rename from crates/puffin/src/compression.rs rename to crates/iceberg/src/puffin/compression.rs index 1cb07bee8..710698df8 100644 --- a/crates/puffin/src/compression.rs +++ b/crates/iceberg/src/puffin/compression.rs @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -use iceberg::{Error, ErrorKind, Result}; +use crate::{Error, ErrorKind, Result}; #[derive(Debug, PartialEq, Eq, Clone, Copy, Default)] /// Data compression formats @@ -70,7 +70,7 @@ impl CompressionCodec { #[cfg(test)] mod tests { - use crate::compression::CompressionCodec; + use crate::puffin::compression::CompressionCodec; #[tokio::test] async fn test_compression_codec_none() { diff --git a/crates/puffin/src/lib.rs b/crates/iceberg/src/puffin/mod.rs similarity index 96% rename from crates/puffin/src/lib.rs rename to crates/iceberg/src/puffin/mod.rs index a76b6a8ab..c13ebe420 100644 --- a/crates/puffin/src/lib.rs +++ b/crates/iceberg/src/puffin/mod.rs @@ -22,4 +22,3 @@ #![allow(dead_code)] mod compression; -pub use compression::CompressionCodec; diff --git a/crates/puffin/Cargo.toml b/crates/puffin/Cargo.toml deleted file mode 100644 index fc62088c8..000000000 --- a/crates/puffin/Cargo.toml +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -[package] -name = "iceberg-puffin" -version = { workspace = true } -edition = { workspace = true } -homepage = { workspace = true } -rust-version = { workspace = true } - -categories = ["database"] -description = "Apache Iceberg Puffin" -repository = { workspace = true } -license = { workspace = true } -keywords = ["iceberg", "puffin"] - -[dependencies] -iceberg = { workspace = true } -zstd = { workspace = true } - -[dev-dependencies] -tokio = { workspace = true }