fix cherry-pick mistake

Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
This commit is contained in:
Duc Canh Le 2024-06-20 07:53:17 +00:00
parent fd3c92318d
commit d4aa1bc5cb

View File

@ -169,7 +169,7 @@ std::pair<ColumnString::Ptr, ColumnString::Ptr> EmbeddedRocksDBBulkSink::seriali
WriteBufferFromVector<ColumnString::Chars> writer_key(serialized_key_data);
WriteBufferFromVector<ColumnString::Chars> writer_value(serialized_value_data);
FormatSettings format_settings; /// Format settings is 1.5KB, so it's not wise to create it for each row
for (const auto & chunk : input_chunks)
for (auto && chunk : input_chunks)
{
const auto & columns = chunk.getColumns();
auto rows = chunk.getNumRows();
@ -177,6 +177,7 @@ std::pair<ColumnString::Ptr, ColumnString::Ptr> EmbeddedRocksDBBulkSink::seriali
{
for (size_t idx = 0; idx < columns.size(); ++idx)
serializations[idx]->serializeBinary(*columns[idx], i, idx == primary_key_pos ? writer_key : writer_value, format_settings);
/// String in ColumnString must be null-terminated
writeChar('\0', writer_key);
writeChar('\0', writer_value);
serialized_key_offsets.emplace_back(writer_key.count());