Skip to content

Commit

Permalink
Always read twice
Browse files Browse the repository at this point in the history
  • Loading branch information
vyasr committed Sep 27, 2024
1 parent b8a4a2a commit 17122a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cpp/src/io/avro/avro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,9 @@ bool container::parse(file_metadata* md, size_t max_num_rows, size_t first_row)
// Read the next sync markers and ensure they match the first ones we
// encountered. If they don't, we have to assume the data is corrupted,
// and thus, we terminate processing immediately.
std::array const sync_marker = {get_raw<uint64_t>(), get_raw<uint64_t>()};
bool valid_sync_markers =
((get_raw<uint64_t>() == md->sync_marker[0]) && (get_raw<uint64_t>() == md->sync_marker[1]));
((sync_marker[0] == md->sync_marker[0]) && (sync_marker[1] == md->sync_marker[1]));
if (!valid_sync_markers) { return false; }
}
md->max_block_size = max_block_size;
Expand Down

0 comments on commit 17122a7

Please sign in to comment.