Skip to content

Commit eece1b1

Browse files
xxhZsxxchanLi0k
authored
feat: exposed file_size_in_bytes (#46)
* mv from 307 * add pub * fix * fix: delete file lost wake Signed-off-by: xxchan <[email protected]> * . Signed-off-by: xxchan <[email protected]> * . Signed-off-by: xxchan <[email protected]> * revert * typo * typo --------- Signed-off-by: xxchan <[email protected]> Co-authored-by: xxchan <[email protected]> Co-authored-by: Li0k <[email protected]>
1 parent cf2aeca commit eece1b1

File tree

7 files changed

+12
-3
lines changed

7 files changed

+12
-3
lines changed

crates/iceberg/src/arrow/reader.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,6 +1523,7 @@ message schema {
15231523
deletes: vec![],
15241524
sequence_number: 0,
15251525
equality_ids: vec![],
1526+
file_size_in_bytes: 0,
15261527
})]
15271528
.into_iter(),
15281529
)) as FileScanTaskStream;

crates/iceberg/src/scan/context.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ impl ManifestEntryContext {
143143
deletes,
144144
sequence_number: self.manifest_entry.sequence_number().unwrap_or(0),
145145
equality_ids: self.manifest_entry.data_file().equality_ids().to_vec(),
146+
file_size_in_bytes: self.manifest_entry.data_file().file_size_in_bytes(),
146147
})
147148
}
148149
}

crates/iceberg/src/scan/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,6 +1795,7 @@ pub mod tests {
17951795
deletes: vec![],
17961796
sequence_number: 0,
17971797
equality_ids: vec![],
1798+
file_size_in_bytes: 0,
17981799
};
17991800
test_fn(task);
18001801

@@ -1812,6 +1813,7 @@ pub mod tests {
18121813
deletes: vec![],
18131814
sequence_number: 0,
18141815
equality_ids: vec![],
1816+
file_size_in_bytes: 0,
18151817
};
18161818
test_fn(task);
18171819
}

crates/iceberg/src/scan/task.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ pub struct FileScanTask {
6363
pub sequence_number: i64,
6464
/// equality ids
6565
pub equality_ids: Vec<i32>,
66+
67+
/// The size of the file in bytes.
68+
pub file_size_in_bytes: u64,
6669
}
6770

6871
impl FileScanTask {
@@ -127,6 +130,7 @@ impl From<&DeleteFileContext> for FileScanTask {
127130
deletes: vec![],
128131
sequence_number: ctx.manifest_entry.sequence_number().unwrap_or(0),
129132
equality_ids: ctx.manifest_entry.data_file().equality_ids().to_vec(),
133+
file_size_in_bytes: ctx.manifest_entry.data_file().file_size_in_bytes(),
130134
}
131135
}
132136
}

crates/iceberg/src/writer/file_writer/location_generator.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ const DEFAULT_DATA_DIR: &str = "/data";
3939
/// `DefaultLocationGenerator` used to generate the data dir location of data file.
4040
/// The location is generated based on the table location and the data location in table properties.
4141
pub struct DefaultLocationGenerator {
42-
dir_path: String,
42+
/// The data dir path of the table.
43+
pub dir_path: String,
4344
}
4445

4546
impl DefaultLocationGenerator {

crates/integrations/datafusion/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub use catalog::*;
2121
mod error;
2222
pub use error::*;
2323

24-
mod physical_plan;
24+
pub mod physical_plan;
2525
mod schema;
2626
mod table;
2727
pub use table::table_provider_factory::IcebergTableProviderFactory;

crates/integrations/datafusion/src/physical_plan/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
pub(crate) mod expr_to_predicate;
18+
pub mod expr_to_predicate;
1919
pub(crate) mod scan;

0 commit comments

Comments
 (0)