Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
2c0a7e3
Init
anlowee Aug 8, 2025
91b499c
Fix the bug of negative small standard decimal; formalize the unit test
anlowee Aug 8, 2025
41eee1a
Add a new NodeType FormattedFloat, and a new config option retain-flo…
anlowee Aug 8, 2025
1a3ef60
Add unit test for FormattedFloat search
anlowee Aug 8, 2025
e4bca46
Add the unit test for rounded cases
anlowee Aug 8, 2025
1c2d47e
Fix a bug that when mantissa greater than 9 or is 0 when it is a non-…
anlowee Aug 8, 2025
32a5375
WIP
anlowee Aug 8, 2025
f6f58be
Finish the doc
anlowee Aug 8, 2025
6bc94cc
Add doc strings
anlowee Aug 8, 2025
8724e11
Fix a bug that significant digits can be negative after refactoring; …
anlowee Aug 8, 2025
1f33f98
Merge branch 'main' into v0.4.0-dev-retain-float-format
kirkrodrigues Aug 11, 2025
15e4346
clp-json: Change clp-s compression task to retain float format.
kirkrodrigues Aug 11, 2025
e5717ef
Wrap some inline comments to 100 chars
anlowee Aug 11, 2025
a4cbd89
Merge branch 'v0.4.0-dev-retain-float-format' of github.com:y-scope/c…
anlowee Aug 11, 2025
30c9b08
Merge branch 'main' into xwei/formatted-double
anlowee Aug 12, 2025
c56275e
Address coderabbitai comments
anlowee Aug 13, 2025
0090052
Merge branch 'xwei/formatted-double' of github.com:anlowee/clp into x…
anlowee Aug 13, 2025
38d5ae4
Address coderaddbitai comments
anlowee Aug 13, 2025
87a131f
Merge branch 'main' into xwei/formatted-double
anlowee Aug 13, 2025
287b43e
Move FormattedFloat before Unknown
anlowee Aug 13, 2025
283ce61
Address coderabbitai comments
anlowee Aug 13, 2025
b0d083d
Address coderabbitai comments
anlowee Aug 13, 2025
3e18f00
Address coderabbitai comments
anlowee Aug 13, 2025
bee4fca
Merge branch 'main' into xwei/formatted-double
anlowee Aug 13, 2025
71f2fb6
Adderss coderabbitai comments
anlowee Aug 13, 2025
e6ac492
Merge branch 'main' into xwei/formatted-double
anlowee Aug 13, 2025
42347c1
Merge branch 'main' into xwei/formatted-double
anlowee Aug 13, 2025
284027c
Merge branch 'main' into xwei/formatted-double
anlowee Aug 14, 2025
3870058
Merge branch 'main' into xwei/formatted-double
anlowee Aug 19, 2025
eff80ce
Merge branch 'main' into xwei/formatted-double
anlowee Aug 20, 2025
03506bc
Merge branch 'main' into xwei/formatted-double
anlowee Aug 22, 2025
4da57f3
Address part of comments
anlowee Aug 22, 2025
e8db268
Merge branch 'main' into xwei/formatted-double
anlowee Aug 22, 2025
5a385c6
Fix bug
anlowee Aug 29, 2025
c43884d
Move whitespace trimming into JsonParser to simplify extracting float…
gibber9809 Sep 2, 2025
b6b364a
Merge remote-tracking branch 'upstream/main' into xwei/formatted-double
gibber9809 Sep 2, 2025
e72ea13
Fix format
gibber9809 Sep 2, 2025
c0982e7
Move float format encoding logic into dedicated function
gibber9809 Sep 2, 2025
464f3b6
Remove remaining asserts in get_float_encoding
gibber9809 Sep 3, 2025
5425f84
Move float format restoration into FloatFormatEncoding
gibber9809 Sep 4, 2025
cfc3740
Explicitly set locale when marshalling floats per rabbit suggestion
gibber9809 Sep 5, 2025
98e0390
Clean up some bithacks; Fix bug introduced when moving floating point…
gibber9809 Sep 5, 2025
b5c1987
More cleanup in float formatting
gibber9809 Sep 5, 2025
091a3fc
Clean up more bithacks
gibber9809 Sep 5, 2025
731bf83
Add support for retaining up to 17 decimal digits; Update tests by in…
gibber9809 Sep 5, 2025
1d3fd9f
Get rid of remaining assert statements and instead return error codes
gibber9809 Sep 5, 2025
bf9cfb0
Add the beginnings of fuzzing tests for floating point formatting and…
gibber9809 Sep 8, 2025
18e5aaf
Extend fuzzing tests to cover a wide variety of cases.
gibber9809 Sep 9, 2025
af19cc6
Remove unnecessary generate statement in float search tests.
gibber9809 Sep 9, 2025
ab38a34
Define float_format_t type
gibber9809 Sep 9, 2025
73da7f3
Remove dedicated namespace for float formatting
gibber9809 Sep 9, 2025
fcea117
Move float format parsing from column writer to json parser
gibber9809 Sep 9, 2025
7ed2c91
Add support for dictionary encoding floating point numbers.
gibber9809 Sep 9, 2025
bf9b6cb
Fix cmake scripts
gibber9809 Sep 9, 2025
0197735
Return protocol_not_supported for more unsupported cases in get_float…
gibber9809 Sep 9, 2025
c1bf459
Check for even more unsupported cases in get_float_format
gibber9809 Sep 9, 2025
eb9a711
Properly handle zeroes and add explicit tests for zeroes.
gibber9809 Sep 9, 2025
ef79776
Merge remote-tracking branch 'upstream/main' into xwei/formatted-double
gibber9809 Sep 9, 2025
05fd52c
Add missing header
gibber9809 Sep 9, 2025
1c2a209
Remove now-unused test results file.
gibber9809 Sep 10, 2025
d4ef78b
Remove unnecessary newlines in test log files.
gibber9809 Sep 10, 2025
86ed676
Explicilty check that round trips for formatted floats will be succes…
gibber9809 Sep 10, 2025
c1b2960
Remove integer test cases from floating point test.
gibber9809 Sep 10, 2025
c38d22a
Fix edge case where scientific zeros with one digit 0e0 weren't encod…
gibber9809 Sep 10, 2025
0d4b607
Verify that floats are encoded as the expected type in end to end tests
gibber9809 Sep 10, 2025
0e15df7
Add tests for non-754 floats
gibber9809 Sep 10, 2025
6813e1e
Merge remote-tracking branch 'upstream/main' into xwei/formatted-double
gibber9809 Sep 10, 2025
200a320
Update design-retain-float-format.md doc
gibber9809 Sep 10, 2025
dafb471
Remove limitations in user-docs.
gibber9809 Sep 10, 2025
f9725db
Update description of retain-float-format command line argument
gibber9809 Sep 10, 2025
7c0d698
Revert docs changes since they have been split off into PR #1298
gibber9809 Sep 10, 2025
a2a31b0
Address rabbit comment
gibber9809 Sep 10, 2025
b997d17
Remove unused constant
gibber9809 Sep 10, 2025
b8e2d50
Apply another rabbit suggestion.
gibber9809 Sep 10, 2025
2f70218
Fix build issue
gibber9809 Sep 11, 2025
3894a4d
Add test cases for max and min subnormal float roundtrip
gibber9809 Sep 11, 2025
b37df69
Rename test_rounded_formatted_float.jsonl to test_invalid_formatted_f…
gibber9809 Sep 11, 2025
89e9a1f
Address review comments
gibber9809 Sep 11, 2025
903e6c2
Apply suggestions from code review
gibber9809 Sep 11, 2025
46983ae
Explicitly check that exponent digits are zero for zero valued numbers
gibber9809 Sep 11, 2025
0aca1e2
Add suggested test cases
gibber9809 Sep 11, 2025
7da0c1d
Update components/core/tests/test_log_files/test_invalid_formatted_fl…
gibber9809 Sep 11, 2025
5fbdd07
Update components/core/src/clp_s/ColumnWriter.cpp
gibber9809 Sep 11, 2025
cda2121
Merge branch 'main' into xwei/formatted-double
gibber9809 Sep 11, 2025
f6e1024
Merge branch 'main' into xwei/formatted-double
anlowee Sep 12, 2025
2f25beb
Bump patch version
gibber9809 Sep 15, 2025
66a7e8e
Merge remote-tracking branch 'upstream/main' into xwei/formatted-double
gibber9809 Sep 15, 2025
1504898
Merge branch 'main' into xwei/formatted-double
anlowee Sep 16, 2025
c0b7e84
Merge remote-tracking branch 'upstream/main' into xwei/formatted-double
gibber9809 Sep 18, 2025
c0d6f4c
Merge branch 'main' into xwei/formatted-double
anlowee Sep 19, 2025
29fcbf2
Merge branch 'main' into xwei/formatted-double
anlowee Sep 22, 2025
777f126
Fix build issues after merge
gibber9809 Sep 22, 2025
bb46862
Merge branch 'main' into xwei/formatted-double
gibber9809 Sep 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions components/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,8 @@ set(SOURCE_FILES_clp_s_unitTest
src/clp_s/FileReader.hpp
src/clp_s/FileWriter.cpp
src/clp_s/FileWriter.hpp
src/clp_s/FloatFormatEncoding.cpp
src/clp_s/FloatFormatEncoding.hpp
Comment thread
anlowee marked this conversation as resolved.
src/clp_s/InputConfig.cpp
src/clp_s/InputConfig.hpp
src/clp_s/JsonConstructor.cpp
Expand Down Expand Up @@ -700,6 +702,7 @@ set(SOURCE_FILES_unitTest
tests/test-ffi_KeyValuePairLogEvent.cpp
tests/test-ffi_SchemaTree.cpp
tests/test-FileDescriptorReader.cpp
tests/test-FloatFormatEncoding.cpp
tests/test-GlobalMetadataDBConfig.cpp
tests/test-GrepCore.cpp
tests/test-hash_utils.cpp
Expand Down
2 changes: 2 additions & 0 deletions components/core/cmake/Options/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ function(set_clp_s_archivereader_dependencies)
CLP_NEED_MSGPACKCXX
CLP_NEED_NLOHMANN_JSON
CLP_NEED_SPDLOG
CLP_NEED_YSTDLIB
)
endfunction()

Expand All @@ -234,6 +235,7 @@ function(set_clp_s_archivewriter_dependencies)
CLP_NEED_NLOHMANN_JSON
CLP_NEED_SIMDJSON
CLP_NEED_SPDLOG
CLP_NEED_YSTDLIB
)
endfunction()

Expand Down
12 changes: 12 additions & 0 deletions components/core/src/clp_s/ArchiveReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ BaseColumnReader* ArchiveReader::append_reader_column(SchemaReader& reader, int3
case NodeType::Float:
column_reader = new FloatColumnReader(column_id);
break;
case NodeType::FormattedFloat:
column_reader = new FormattedFloatColumnReader(column_id);
break;
case NodeType::DictionaryFloat:
column_reader = new DictionaryFloatColumnReader(column_id, m_var_dict);
break;
case NodeType::ClpString:
column_reader = new ClpStringColumnReader(column_id, m_var_dict, m_log_dict);
break;
Expand Down Expand Up @@ -247,6 +253,12 @@ void ArchiveReader::append_unordered_reader_columns(
case NodeType::Float:
column_reader = new FloatColumnReader(column_id);
break;
case NodeType::FormattedFloat:
column_reader = new FormattedFloatColumnReader(column_id);
break;
case NodeType::DictionaryFloat:
column_reader = new DictionaryFloatColumnReader(column_id, m_var_dict);
break;
case NodeType::ClpString:
column_reader = new ClpStringColumnReader(column_id, m_var_dict, m_log_dict);
break;
Expand Down
6 changes: 6 additions & 0 deletions components/core/src/clp_s/ArchiveWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,12 @@ void ArchiveWriter::initialize_schema_writer(SchemaWriter* writer, Schema const&
case NodeType::Float:
writer->append_column(new FloatColumnWriter(id));
break;
case NodeType::FormattedFloat:
writer->append_column(new FormattedFloatColumnWriter(id));
break;
Comment thread
anlowee marked this conversation as resolved.
case NodeType::DictionaryFloat:
writer->append_column(new DictionaryFloatColumnWriter(id, m_var_dict));
break;
case NodeType::ClpString:
writer->append_column(new ClpStringColumnWriter(id, m_var_dict, m_log_dict));
break;
Expand Down
6 changes: 6 additions & 0 deletions components/core/src/clp_s/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ set(
DictionaryWriter.cpp
DictionaryWriter.hpp
ErrorCode.hpp
FloatFormatEncoding.cpp
FloatFormatEncoding.hpp
JsonFileIterator.cpp
Comment on lines +235 to 237

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick

Adding FloatFormatEncoding to writer sources: SGTM

Good to see the encoding module compiled into the writer.

If this module will be shared broadly (writer, reader, json constructor, etc.), consider extracting it into a tiny common target (e.g., clp_s::float_format) and linking both writer/reader to it to avoid repeated compilation. Not urgent given existing project patterns.

🤖 Prompt for AI Agents
In components/core/src/clp_s/CMakeLists.txt around lines 229-231,
FloatFormatEncoding sources were added directly to the writer target; to avoid
duplicate compilation when this module is used by multiple targets, create a
small common library target (e.g., clp_s::float_format) that contains
FloatFormatEncoding.cpp/.hpp and any related sources/headers, set its include
directories and target properties, then remove those files from the writer
sources and link both the writer and any other consumers (reader, json
constructor) against clp_s::float_format using target_link_libraries so they
share a single compiled implementation.

JsonFileIterator.hpp
JsonParser.cpp
Expand Down Expand Up @@ -274,6 +276,7 @@ if(CLP_BUILD_CLP_S_ARCHIVEWRITER)
msgpack-cxx
nlohmann_json::nlohmann_json
simdjson::simdjson
ystdlib::error_handling
PRIVATE
Boost::url
clp_s::clp_dependencies
Expand All @@ -299,6 +302,8 @@ set(
DictionaryEntry.hpp
DictionaryReader.hpp
ErrorCode.hpp
FloatFormatEncoding.cpp
FloatFormatEncoding.hpp
JsonSerializer.hpp
Comment on lines +305 to 307

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick

Adding FloatFormatEncoding to reader sources: SGTM

Mirrors the writer change; necessary for decode/restore path.

Same optional note as above: consider a small shared target if this module expands or is reused elsewhere.

🤖 Prompt for AI Agents
In components/core/src/clp_s/CMakeLists.txt around lines 299 to 301, the
FloatFormatEncoding source files are missing from the reader target; add
FloatFormatEncoding.cpp and FloatFormatEncoding.hpp to the reader sources (and
keep JsonSerializer.hpp) so the decode/restore path builds correctly, and
consider refactoring into a small shared/static library target if this module
will be reused to avoid duplication.

PackedStreamReader.cpp
PackedStreamReader.hpp
Expand Down Expand Up @@ -335,6 +340,7 @@ if(CLP_BUILD_CLP_S_ARCHIVEREADER)
clp_s::io
msgpack-cxx
nlohmann_json::nlohmann_json
ystdlib::error_handling
PRIVATE
Boost::url
clp_s::clp_dependencies
Expand Down
41 changes: 41 additions & 0 deletions components/core/src/clp_s/ColumnReader.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
#include "ColumnReader.hpp"

#include <cstddef>
#include <cstdint>
#include <string>
#include <variant>

#include "../clp/EncodedVariableInterpreter.hpp"
#include "BufferViewReader.hpp"
#include "ColumnWriter.hpp"
#include "FloatFormatEncoding.hpp"
#include "Utils.hpp"

namespace clp_s {
Expand Down Expand Up @@ -50,6 +56,11 @@ void FloatColumnReader::load(BufferViewReader& reader, uint64_t num_messages) {
m_values = reader.read_unaligned_span<double>(num_messages);
}

void FormattedFloatColumnReader::load(BufferViewReader& reader, uint64_t num_messages) {
m_values = reader.read_unaligned_span<double>(num_messages);
m_formats = reader.read_unaligned_span<float_format_t>(num_messages);
}

void
Int64ColumnReader::extract_string_value_into_buffer(uint64_t cur_message, std::string& buffer) {
buffer.append(std::to_string(m_values[cur_message]));
Expand All @@ -68,6 +79,12 @@ std::variant<int64_t, double, std::string, uint8_t> FloatColumnReader::extract_v
return m_values[cur_message];
}

std::variant<int64_t, double, std::string, uint8_t> FormattedFloatColumnReader::extract_value(
uint64_t cur_message
) {
return m_values[cur_message];
}

void BooleanColumnReader::load(BufferViewReader& reader, uint64_t num_messages) {
m_values = reader.read_unaligned_span<uint8_t>(num_messages);
}
Expand All @@ -77,12 +94,36 @@ FloatColumnReader::extract_string_value_into_buffer(uint64_t cur_message, std::s
buffer.append(std::to_string(m_values[cur_message]));
}

void FormattedFloatColumnReader::extract_string_value_into_buffer(
uint64_t cur_message,
std::string& buffer
) {
buffer.append(restore_encoded_float(m_values[cur_message], m_formats[cur_message]).value());
}

std::variant<int64_t, double, std::string, uint8_t> BooleanColumnReader::extract_value(
uint64_t cur_message
) {
return m_values[cur_message];
}

void DictionaryFloatColumnReader::load(BufferViewReader& reader, uint64_t num_messages) {
m_var_dict_ids = reader.read_unaligned_span<variable_dictionary_id_t>(num_messages);
}

std::variant<int64_t, double, std::string, uint8_t> DictionaryFloatColumnReader::extract_value(
uint64_t cur_message
) {
return std::stod(m_var_dict->get_value(m_var_dict_ids[cur_message]));
}
Comment thread
anlowee marked this conversation as resolved.

void DictionaryFloatColumnReader::extract_string_value_into_buffer(
uint64_t cur_message,
std::string& buffer
) {
buffer.append(m_var_dict->get_value(m_var_dict_ids[cur_message]));
}

void ClpStringColumnReader::load(BufferViewReader& reader, uint64_t num_messages) {
m_logtypes = reader.read_unaligned_span<uint64_t>(num_messages);
size_t encoded_vars_length = reader.read_value<size_t>();
Expand Down
63 changes: 63 additions & 0 deletions components/core/src/clp_s/ColumnReader.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#ifndef CLP_S_COLUMNREADER_HPP
#define CLP_S_COLUMNREADER_HPP

#include <cstddef>
#include <cstdint>
Comment thread
anlowee marked this conversation as resolved.
#include <string>
#include <variant>

#include "BufferViewReader.hpp"
#include "DictionaryReader.hpp"
#include "FloatFormatEncoding.hpp"
#include "SchemaTree.hpp"
#include "TimestampDictionaryReader.hpp"
#include "Utils.hpp"
Expand Down Expand Up @@ -147,6 +150,66 @@ class FloatColumnReader : public BaseColumnReader {
UnalignedMemSpan<double> m_values;
};

class FormattedFloatColumnReader : public BaseColumnReader {
public:
// Constructor
explicit FormattedFloatColumnReader(int32_t id) : BaseColumnReader(id) {}

// Destructor
~FormattedFloatColumnReader() override = default;

// Methods inherited from BaseColumnReader
void load(BufferViewReader& reader, uint64_t num_messages) override;

NodeType get_type() override { return NodeType::FormattedFloat; }

std::variant<int64_t, double, std::string, uint8_t> extract_value(
uint64_t cur_message
) override;

/**
* Appends the floating point value to the buffer in its original format by decoding the stored
* format information.
*
* @param cur_message
* @param buffer
*/
void extract_string_value_into_buffer(uint64_t cur_message, std::string& buffer) override;

private:
UnalignedMemSpan<double> m_values;
UnalignedMemSpan<float_format_t> m_formats;
};

class DictionaryFloatColumnReader : public BaseColumnReader {
public:
// Constructor
explicit DictionaryFloatColumnReader(
int32_t id,
std::shared_ptr<VariableDictionaryReader> var_dict
)
: BaseColumnReader(id),
m_var_dict{std::move(var_dict)} {}

// Destructor
~DictionaryFloatColumnReader() override = default;

// Methods inherited from BaseColumnReader
void load(BufferViewReader& reader, uint64_t num_messages) override;

NodeType get_type() override { return NodeType::DictionaryFloat; }

std::variant<int64_t, double, std::string, uint8_t> extract_value(
uint64_t cur_message
) override;

void extract_string_value_into_buffer(uint64_t cur_message, std::string& buffer) override;

private:
std::shared_ptr<VariableDictionaryReader> m_var_dict;
UnalignedMemSpan<variable_dictionary_id_t> m_var_dict_ids;
};
Comment thread
anlowee marked this conversation as resolved.

class BooleanColumnReader : public BaseColumnReader {
public:
// Constructor
Expand Down
30 changes: 30 additions & 0 deletions components/core/src/clp_s/ColumnWriter.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include "ColumnWriter.hpp"

#include <algorithm>
#include <cassert>
#include <cctype>
#include <cstdint>
#include <variant>

Expand Down Expand Up @@ -46,6 +49,33 @@ void FloatColumnWriter::store(ZstdCompressor& compressor) {
compressor.write(reinterpret_cast<char const*>(m_values.data()), size);
}

size_t FormattedFloatColumnWriter::add_value(ParsedMessage::variable_t& value) {
Comment thread
anlowee marked this conversation as resolved.
auto const& [float_value, format]{std::get<std::pair<double, float_format_t>>(value)};
m_values.push_back(float_value);
m_formats.push_back(format);
return sizeof(double) + sizeof(float_format_t);
}

void FormattedFloatColumnWriter::store(ZstdCompressor& compressor) {
assert(m_formats.size() == m_values.size());
auto const values_size = m_values.size() * sizeof(double);
auto const format_size = m_formats.size() * sizeof(float_format_t);
compressor.write(reinterpret_cast<char const*>(m_values.data()), values_size);
compressor.write(reinterpret_cast<char const*>(m_formats.data()), format_size);
}
Comment thread
anlowee marked this conversation as resolved.

size_t DictionaryFloatColumnWriter::add_value(ParsedMessage::variable_t& value) {
clp::variable_dictionary_id_t id{};
m_var_dict->add_entry(std::get<std::string>(value), id);
m_var_dict_ids.push_back(id);
return sizeof(clp::variable_dictionary_id_t);
}

void DictionaryFloatColumnWriter::store(ZstdCompressor& compressor) {
auto size{m_var_dict_ids.size() * sizeof(clp::variable_dictionary_id_t)};
compressor.write(reinterpret_cast<char const*>(m_var_dict_ids.data()), size);
}

size_t BooleanColumnWriter::add_value(ParsedMessage::variable_t& value) {
m_values.push_back(std::get<bool>(value) ? 1 : 0);
return sizeof(uint8_t);
Expand Down
39 changes: 39 additions & 0 deletions components/core/src/clp_s/ColumnWriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "../clp/Defs.h"
#include "DictionaryWriter.hpp"
#include "FileWriter.hpp"
#include "FloatFormatEncoding.hpp"
Comment thread
anlowee marked this conversation as resolved.
#include "ParsedMessage.hpp"
#include "TimestampDictionaryWriter.hpp"
#include "ZstdCompressor.hpp"
Expand Down Expand Up @@ -98,6 +99,44 @@ class FloatColumnWriter : public BaseColumnWriter {
std::vector<double> m_values;
};

class FormattedFloatColumnWriter : public BaseColumnWriter {
public:
// Constructor
explicit FormattedFloatColumnWriter(int32_t id) : BaseColumnWriter(id) {}

// Destructor
~FormattedFloatColumnWriter() override = default;

// Methods inherited from BaseColumnWriter
size_t add_value(ParsedMessage::variable_t& value) override;

void store(ZstdCompressor& compressor) override;

private:
std::vector<double> m_values;
std::vector<float_format_t> m_formats;
};

class DictionaryFloatColumnWriter : public BaseColumnWriter {
public:
// Constructor
DictionaryFloatColumnWriter(int32_t id, std::shared_ptr<VariableDictionaryWriter> var_dict)
: BaseColumnWriter(id),
m_var_dict(std::move(var_dict)) {}

// Destructor
~DictionaryFloatColumnWriter() override = default;

// Methods inherited from BaseColumnWriter
size_t add_value(ParsedMessage::variable_t& value) override;

void store(ZstdCompressor& compressor) override;

private:
std::shared_ptr<VariableDictionaryWriter> m_var_dict;
std::vector<clp::variable_dictionary_id_t> m_var_dict_ids;
};

class BooleanColumnWriter : public BaseColumnWriter {
public:
// Constructor
Expand Down
4 changes: 4 additions & 0 deletions components/core/src/clp_s/CommandLineArguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ CommandLineArguments::parse_arguments(int argc, char const** argv) {
"print-archive-stats",
po::bool_switch(&m_print_archive_stats),
"Print statistics (json) about the archive after it's compressed."
)(
"retain-float-format",
po::bool_switch(&m_retain_float_format),
"Store extra information to losslessly decompress floats."
)(
"single-file-archive",
po::bool_switch(&m_single_file_archive),
Expand Down
3 changes: 3 additions & 0 deletions components/core/src/clp_s/CommandLineArguments.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ class CommandLineArguments {

OutputHandlerType get_output_handler_type() const { return m_output_handler_type; }

[[nodiscard]] bool get_retain_float_format() const { return m_retain_float_format; }

bool get_single_file_archive() const { return m_single_file_archive; }

bool get_structurize_arrays() const { return m_structurize_arrays; }
Expand Down Expand Up @@ -179,6 +181,7 @@ class CommandLineArguments {
size_t m_target_encoded_size{8ULL * 1024 * 1024 * 1024}; // 8 GiB
bool m_print_archive_stats{false};
size_t m_max_document_size{512ULL * 1024 * 1024}; // 512 MB
bool m_retain_float_format{false};
bool m_single_file_archive{false};
bool m_structurize_arrays{false};
bool m_ordered_decompression{false};
Expand Down
Loading
Loading