Skip to content

Commit 83e68a7

Browse files
Fix formatting issues
1 parent 86eef49 commit 83e68a7

3 files changed

Lines changed: 40 additions & 26 deletions

File tree

examples/basic_query.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
2525
use datafusion::execution::runtime_env::RuntimeEnv;
2626
use datafusion::prelude::*;
27-
use datafusion_ducklake::{DuckLakeCatalog, DuckdbMetadataProvider, MetadataProvider, register_ducklake_functions};
27+
use datafusion_ducklake::{
28+
DuckLakeCatalog, DuckdbMetadataProvider, MetadataProvider, register_ducklake_functions,
29+
};
2830
use object_store::ObjectStore;
2931
use object_store::aws::AmazonS3Builder;
3032
use std::env;

src/information_schema.rs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ impl TablesTable {
240240
.list_all_tables(snapshot_id)
241241
.map_err(|e| datafusion::error::DataFusionError::External(Box::new(e)))?;
242242

243-
let snapshot_ids: ArrayRef = Arc::new(Int64Array::from(vec![snapshot_id; all_tables.len()]));
243+
let snapshot_ids: ArrayRef =
244+
Arc::new(Int64Array::from(vec![snapshot_id; all_tables.len()]));
244245

245246
let schema_names: ArrayRef = Arc::new(StringArray::from(
246247
all_tables
@@ -498,17 +499,17 @@ impl TableInfoTable {
498499
// Tuple: (table_name, schema_id, table_id, file_count, file_size, del_count, del_size)
499500
let mut all_table_info: Vec<_> = table_stats
500501
.into_iter()
501-
.map(|((_schema_name, table_name), (table_id, file_count, file_size, del_count, del_size))| {
502-
(
503-
table_name,
504-
0i64, // schema_id placeholder (not used in display)
505-
table_id,
506-
file_count,
507-
file_size,
508-
del_count,
509-
del_size,
510-
)
511-
})
502+
.map(
503+
|(
504+
(_schema_name, table_name),
505+
(table_id, file_count, file_size, del_count, del_size),
506+
)| {
507+
(
508+
table_name, 0i64, // schema_id placeholder (not used in display)
509+
table_id, file_count, file_size, del_count, del_size,
510+
)
511+
},
512+
)
512513
.collect();
513514

514515
// Sort for deterministic output by table_name

src/metadata_provider_duckdb.rs

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,10 @@ impl MetadataProvider for DuckdbMetadataProvider {
280280
path: row.get(3)?,
281281
path_is_relative: row.get(4)?,
282282
};
283-
Ok(TableWithSchema { schema_name, table })
283+
Ok(TableWithSchema {
284+
schema_name,
285+
table,
286+
})
284287
},
285288
)?
286289
.collect::<Result<Vec<_>, _>>()?;
@@ -321,7 +324,14 @@ impl MetadataProvider for DuckdbMetadataProvider {
321324

322325
let files = stmt
323326
.query_map(
324-
params![snapshot_id, snapshot_id, snapshot_id, snapshot_id, snapshot_id, snapshot_id],
327+
params![
328+
snapshot_id,
329+
snapshot_id,
330+
snapshot_id,
331+
snapshot_id,
332+
snapshot_id,
333+
snapshot_id
334+
],
325335
|row| {
326336
let schema_name: String = row.get(0)?;
327337
let table_name: String = row.get(1)?;
@@ -336,17 +346,18 @@ impl MetadataProvider for DuckdbMetadataProvider {
336346
};
337347

338348
// Parse optional delete file (column 7: delete_file_id, check if exists but don't store)
339-
let delete_file = if let Ok(Some(_delete_file_id)) = row.get::<_, Option<i64>>(7) {
340-
Some(DuckLakeFileData {
341-
path: row.get(8)?,
342-
path_is_relative: row.get(9)?,
343-
file_size_bytes: row.get(10)?,
344-
footer_size: row.get(11)?,
345-
encryption_key: String::new(),
346-
})
347-
} else {
348-
None
349-
};
349+
let delete_file =
350+
if let Ok(Some(_delete_file_id)) = row.get::<_, Option<i64>>(7) {
351+
Some(DuckLakeFileData {
352+
path: row.get(8)?,
353+
path_is_relative: row.get(9)?,
354+
file_size_bytes: row.get(10)?,
355+
footer_size: row.get(11)?,
356+
encryption_key: String::new(),
357+
})
358+
} else {
359+
None
360+
};
350361

351362
let max_row_count = row.get::<_, Option<i64>>(12)?.unwrap_or(0);
352363

0 commit comments

Comments
 (0)