Skip to content

Commit

Permalink
datalake: test new partition key serde in iceberg_file_committer utest
Browse files Browse the repository at this point in the history
  • Loading branch information
ztlpn committed Jan 7, 2025
1 parent 96f1694 commit c51d869
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/v/datalake/coordinator/tests/iceberg_file_committer_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,28 @@ TEST_F(FileCommitterTest, TestFilesGetPartitionKey) {
std::move(offsets),
},
added_at_counter++);

bool first = true;
for (auto& e : t_state.pid_to_pending_files[model::partition_id{0}]
.pending_entries) {
e.data.files.emplace_back(datalake::coordinator::data_file{
datalake::coordinator::data_file file{
.row_count = 100,
.file_size_bytes = 1024,
.hour_deprecated = hour,
});
};

if (first) {
// for the first file, add partition info in the legacy format
file.hour_deprecated = hour;
first = false;
} else {
chunked_vector<std::optional<bytes>> pk;
pk.push_back(value_to_bytes(int_value{hour}));
file.table_schema_id = 0;
file.partition_spec_id = 0;
file.partition_key = std::move(pk);
}

e.data.files.emplace_back(std::move(file));
}
state.topic_to_state[topic] = std::move(t_state);
return state;
Expand Down

0 comments on commit c51d869

Please sign in to comment.