a-agmon commented on code in PR #651: URL: https://github.com/apache/iceberg-rust/pull/651#discussion_r1778693746
########## crates/integrations/datafusion/src/table.rs: ########## @@ -110,3 +110,43 @@ impl TableProvider for IcebergTableProvider { Ok(filter_support) } } + +#[cfg(test)] +mod tests { + use iceberg::io::FileIO; + use iceberg::table::{StaticTable, Table}; + use iceberg::TableIdent; + + use super::*; + + async fn get_test_table_from_metadata_file() -> Table { + let metadata_file_name = "TableMetadataV2Valid.json"; + let metadata_file_path = format!( + "{}/tests/test_data/{}", + env!("CARGO_MANIFEST_DIR"), + metadata_file_name + ); + let file_io = FileIO::from_path(&metadata_file_path) + .unwrap() + .build() + .unwrap(); + let static_identifier = TableIdent::from_strs(["static_ns", "static_table"]).unwrap(); + let static_table = + StaticTable::from_metadata_file(&metadata_file_path, static_identifier, file_io) + .await + .unwrap(); + static_table.into_table() + } + + #[tokio::test] + async fn test_try_new_from_table() { Review Comment: you mean adding something like this: ```rust let ctx = SessionContext::new(); ctx.register_table("mytable", Arc::new(table_provider)) .unwrap(); let df = ctx.sql("SELECT * FROM mytable").await.unwrap(); ``` or running an actual query using it? that would require a real table (the dummy metadata I used is not really pointing at a real location) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org