Skip to content

Commit

Permalink
fix metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel committed Nov 14, 2024
1 parent dacfabd commit ab1db6f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/connector/src/source/iceberg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ pub struct IcebergSplit {
}

impl IcebergSplit {
pub fn empty() -> Self {
pub fn empty(table_meta: TableMetadataJsonStr) -> Self {
Self {
split_id: 0,
snapshot_id: 0,
table_meta: TableMetadataJsonStr("".to_string()),
table_meta,
files: vec![],
equality_delete_files: vec![],
position_delete_files: vec![],
Expand Down Expand Up @@ -214,7 +214,9 @@ impl IcebergSplitEnumerator {
let current_snapshot = table.metadata().current_snapshot();
if current_snapshot.is_none() {
// If there is no snapshot, we will return a mock `IcebergSplit` with empty files.
return Ok(vec![IcebergSplit::empty()]);
return Ok(vec![IcebergSplit::empty(TableMetadataJsonStr::serialize(
table.metadata(),
))]);
}

let snapshot_id = match time_traval_info {
Expand Down Expand Up @@ -320,7 +322,9 @@ impl IcebergSplitEnumerator {
.collect_vec();

if splits.is_empty() {
return Ok(vec![IcebergSplit::empty()]);
return Ok(vec![IcebergSplit::empty(TableMetadataJsonStr::serialize(
table.metadata(),
))]);
}

Ok(splits)
Expand Down

0 comments on commit ab1db6f

Please sign in to comment.