-
Notifications
You must be signed in to change notification settings - Fork 83
feat(clp-s): Expose JSON serialization in SchemaReader
.
#1406
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 2 commits
3b0facd
4a8fbfb
c17497f
8096c93
293a573
378b418
d5411a7
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 | ||||
---|---|---|---|---|---|---|
|
@@ -63,7 +63,7 @@ SchemaReader::load(std::shared_ptr<char[]> stream_buffer, size_t offset, size_t | |||||
} | ||||||
} | ||||||
|
||||||
void SchemaReader::generate_json_string() { | ||||||
std::string SchemaReader::generate_json_string(uint64_t message_index) { | ||||||
|
std::string SchemaReader::generate_json_string(uint64_t message_index) { | |
auto SchemaReader::generate_json_string(uint64_t message_index) -> std::string { |
Same as other comment.
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -154,6 +154,13 @@ class SchemaReader { | |||||||||||||||||||||
*/ | ||||||||||||||||||||||
uint64_t get_num_messages() const { return m_num_messages; } | ||||||||||||||||||||||
|
||||||||||||||||||||||
/** | ||||||||||||||||||||||
* Generates a json string from the extracted values | ||||||||||||||||||||||
* @param message_index the index of the message to generate the json string for | ||||||||||||||||||||||
* @return the generated json string | ||||||||||||||||||||||
*/ | ||||||||||||||||||||||
std::string generate_json_string(uint64_t message_index); | ||||||||||||||||||||||
|
* Generates a json string from the extracted values | |
* @param message_index the index of the message to generate the json string for | |
* @return the generated json string | |
*/ | |
std::string generate_json_string(uint64_t message_index); | |
* Generates a json string from the encoded columns. | |
* @param message_index The index of the message to generate the JSON string for. | |
* @return The generated JSON string. | |
*/ | |
[[nodiscard]] auto generate_json_string(uint64_t message_index) -> std::string; |
Updating the comment a bit since I'm pretty sure that extracted values line refers to a very old implementation + updating the prototype to comply with our current standard since we're touching this anyway.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Initializes all internal data structured required to serialize records. | |
* Initializes all internal data structures required to serialize records. |
Just explicitly adding my other comment as an edit suggestion. After this should be good to merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add bounds validation for
message_index
.The function doesn't validate that
message_index < m_num_messages
. Out-of-bounds access in column readers could cause undefined behaviour or crashes.Apply this diff to add bounds checking:
📝 Committable suggestion
🤖 Prompt for AI Agents