-
Notifications
You must be signed in to change notification settings - Fork 91
feat(clp-s): Add Timestamp schema tree node type to introduce the timestamp column; Add timestamp column reader and writer.
#1873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
ea32aec
fc54126
2a89278
661b381
e02701a
7194e1e
56a5ff6
8810fd6
7cbd80d
dcc25bf
2989b06
cf76928
0ab13ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,18 +28,21 @@ void Int64ColumnWriter::store(ZstdCompressor& compressor) { | |
| compressor.write(reinterpret_cast<char const*>(m_values.data()), size); | ||
| } | ||
|
|
||
| size_t DeltaEncodedInt64ColumnWriter::add_value(ParsedMessage::variable_t& value) { | ||
| auto DeltaEncodedInt64ColumnWriter::add_value(int64_t value) -> size_t { | ||
| if (0 == m_values.size()) { | ||
| m_cur = std::get<int64_t>(value); | ||
| m_values.push_back(m_cur); | ||
| m_cur = value; | ||
| m_values.emplace_back(m_cur); | ||
| } else { | ||
| auto next = std::get<int64_t>(value); | ||
| m_values.push_back(next - m_cur); | ||
| m_cur = next; | ||
| m_values.emplace_back(value - m_cur); | ||
| m_cur = value; | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like we could just use: m_values.emplace_back(value - m_cur);
m_cur = value;because
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch! |
||
| return sizeof(int64_t); | ||
| } | ||
|
|
||
| size_t DeltaEncodedInt64ColumnWriter::add_value(ParsedMessage::variable_t& value) { | ||
| return add_value(std::get<int64_t>(value)); | ||
| } | ||
|
|
||
| void DeltaEncodedInt64ColumnWriter::store(ZstdCompressor& compressor) { | ||
| size_t size = m_values.size() * sizeof(int64_t); | ||
| compressor.write(reinterpret_cast<char const*>(m_values.data()), size); | ||
|
|
@@ -181,4 +184,17 @@ void DateStringColumnWriter::store(ZstdCompressor& compressor) { | |
| size_t encodings_size = m_timestamp_encodings.size() * sizeof(int64_t); | ||
| compressor.write(reinterpret_cast<char const*>(m_timestamp_encodings.data()), encodings_size); | ||
| } | ||
|
|
||
| auto TimestampColumnWriter::add_value(ParsedMessage::variable_t& value) -> size_t { | ||
| auto const& encoded_timestamp = std::get<std::pair<epochtime_t, uint64_t>>(value); | ||
| auto const encoded_timestamp_size{m_timestamps.add_value(encoded_timestamp.first)}; | ||
| m_timestamp_encodings.emplace_back(encoded_timestamp.second); | ||
|
gibber9809 marked this conversation as resolved.
Outdated
|
||
| return encoded_timestamp_size + sizeof(uint64_t); | ||
| } | ||
|
|
||
| void TimestampColumnWriter::store(ZstdCompressor& compressor) { | ||
| m_timestamps.store(compressor); | ||
| size_t const encodings_size{m_timestamp_encodings.size() * sizeof(uint64_t)}; | ||
| compressor.write(reinterpret_cast<char const*>(m_timestamp_encodings.data()), encodings_size); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lol, I hope at some day we can drop all |
||
| } | ||
| } // namespace clp_s | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,7 @@ class ParsedMessage { | |
| clp::ffi::FourByteEncodedTextAst, | ||
| bool, | ||
| std::pair<uint64_t, epochtime_t>, | ||
| std::pair<epochtime_t, uint64_t>, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| std::pair<double, float_format_t>>; | ||
|
|
||
| // Constructor | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.