Skip to content

Commit 1722e11

Browse files
committed
Merge pull request JanKaul#223 from JanKaul/more-context-for-unimplemented
provide more context for unimplemented macro
2 parents 2e2cf62 + 1c885ab commit 1722e11

File tree

35 files changed

+846
-235
lines changed

35 files changed

+846
-235
lines changed

.github/workflows/rust.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ jobs:
1313
test:
1414
runs-on: ubuntu-latest
1515
steps:
16+
- name: Free disk space
17+
uses: jlumbroso/free-disk-space@main
18+
with:
19+
tool-cache: false
20+
android: true
21+
dotnet: true
22+
haskell: true
23+
large-packages: false
24+
docker-images: false
25+
swap-storage: false
1626
- uses: actions/checkout@v3
1727
- name: Build
1828
run: cargo build --verbose

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ test-iceberg-rust:
77
cargo test -p iceberg-rust --lib
88

99
test-datafusion_iceberg:
10-
cargo test -p datafusion_iceberg --tests -j 2 && cargo clean -p datafusion_iceberg
10+
cargo test -p datafusion_iceberg --tests -j 2
1111

1212
test-rest-catalog:
13-
cargo test -p iceberg-rest-catalog --lib && cargo clean -p iceberg-rest-catalog
13+
cargo test -p iceberg-rest-catalog --lib
1414

1515
test-file-catalog:
16-
cargo test -p iceberg-file-catalog --lib && cargo clean -p iceberg-file-catalog
16+
cargo test -p iceberg-file-catalog --lib
1717

1818
test-sql-catalog:
19-
cargo test -p iceberg-sql-catalog --lib && cargo clean -p iceberg-sql-catalog
19+
cargo test -p iceberg-sql-catalog --lib
2020
clippy:
2121
cargo clippy --all-targets --all-features -- -D warnings
2222
fmt:

catalogs/iceberg-file-catalog/src/lib.rs

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ impl Catalog for FileCatalog {
506506
_identifier: Identifier,
507507
_metadata_location: &str,
508508
) -> Result<Table, IcebergError> {
509-
unimplemented!()
509+
unimplemented!("Register table for file catalog")
510510
}
511511
}
512512

@@ -663,12 +663,13 @@ pub mod tests {
663663
arrow::array::{Float64Array, Int64Array},
664664
common::tree_node::{TransformedResult, TreeNode},
665665
execution::SessionStateBuilder,
666-
prelude::SessionContext,
666+
prelude::{SessionConfig, SessionContext},
667667
};
668668
use datafusion_iceberg::{
669669
catalog::catalog::IcebergCatalog,
670670
planner::{iceberg_transform, IcebergQueryPlanner},
671671
};
672+
use futures::StreamExt;
672673
use iceberg_rust::{
673674
catalog::{namespace::Namespace, Catalog},
674675
object_store::{Bucket, ObjectStoreBuilder},
@@ -734,7 +735,17 @@ pub mod tests {
734735
.unwrap(),
735736
);
736737

738+
let mut config = SessionConfig::default();
739+
740+
config.options_mut().execution.minimum_parallel_output_files = 1;
741+
config
742+
.options_mut()
743+
.execution
744+
.parquet
745+
.maximum_parallel_row_group_writers = 4;
746+
737747
let state = SessionStateBuilder::new()
748+
.with_config(config)
738749
.with_default_features()
739750
.with_query_planner(Arc::new(IcebergQueryPlanner::new()))
740751
.build();
@@ -801,7 +812,7 @@ pub mod tests {
801812
L_RECEIPTDATE DATE NOT NULL,
802813
L_SHIPINSTRUCT VARCHAR NOT NULL,
803814
L_SHIPMODE VARCHAR NOT NULL,
804-
L_COMMENT VARCHAR NOT NULL ) STORED AS ICEBERG LOCATION 's3://warehouse/tpch/lineitem' PARTITIONED BY ( \"month(L_SHIPDATE)\" );";
815+
L_COMMENT VARCHAR NOT NULL ) STORED AS ICEBERG LOCATION 's3://warehouse/tpch/lineitem';";
805816

806817
let plan = ctx.state().create_logical_plan(sql).await.unwrap();
807818

@@ -889,6 +900,21 @@ pub mod tests {
889900
std::str::from_utf8(&version_hint).unwrap(),
890901
"s3://warehouse/tpch/lineitem/metadata/v1.metadata.json"
891902
);
903+
904+
let files = object_store.list(None).collect::<Vec<_>>().await;
905+
906+
assert_eq!(
907+
files
908+
.iter()
909+
.filter(|x| x
910+
.as_ref()
911+
.unwrap()
912+
.location
913+
.extension()
914+
.is_some_and(|x| x == "parquet"))
915+
.count(),
916+
1
917+
);
892918
}
893919

894920
#[tokio::test]

datafusion_iceberg/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ derive_builder = { workspace = true }
1919
futures = { workspace = true }
2020
iceberg-rust = { path = "../iceberg-rust", version = "0.8.0" }
2121
itertools = { workspace = true }
22+
lru = { workspace = true }
2223
object_store = { workspace = true }
2324
pin-project-lite = "0.2.16"
2425
regex = "1.11.1"
2526
serde_json = { workspace = true }
2627
thiserror = { workspace = true }
2728
tokio = { version = "1.43", features = ["rt-multi-thread"] }
29+
tracing = { workspace = true }
2830
url = { workspace = true }
2931
uuid = { workspace = true }
3032

datafusion_iceberg/src/error.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Error type for iceberg
33
*/
44

5-
use datafusion::error::DataFusionError;
5+
use datafusion::{arrow::array::RecordBatch, error::DataFusionError};
66
use iceberg_rust::error::Error as IcebergError;
77
use thiserror::Error;
88

@@ -54,9 +54,18 @@ pub enum Error {
5454
/// parse int error
5555
#[error(transparent)]
5656
ParseInt(#[from] std::num::ParseIntError),
57+
/// Tokio error
58+
#[error(transparent)]
59+
TokioSend(
60+
#[from]
61+
tokio::sync::mpsc::error::SendError<(
62+
object_store::path::Path,
63+
tokio::sync::mpsc::Receiver<RecordBatch>,
64+
)>,
65+
),
5766
/// parse int error
5867
#[error(transparent)]
59-
ConfigBuilder(#[from] crate::table::DataFusionTableConfigBuilderError),
68+
DeriveBuilder(#[from] derive_builder::UninitializedFieldError),
6069
}
6170

6271
impl From<Error> for DataFusionError {

0 commit comments

Comments
 (0)