ColinLeeo commented on code in PR #739:
URL: https://github.com/apache/tsfile/pull/739#discussion_r2958379551
##########
cpp/src/common/tablet.cc:
##########
@@ -163,6 +163,89 @@ int Tablet::add_timestamp(uint32_t row_index, int64_t
timestamp) {
return E_OK;
}
+int Tablet::set_timestamps(const int64_t* timestamps, uint32_t count) {
+ if (err_code_ != E_OK) {
+ return err_code_;
+ }
+ ASSERT(timestamps_ != NULL);
+ if (UNLIKELY(count > static_cast<uint32_t>(max_row_num_))) {
+ return E_OUT_OF_RANGE;
+ }
+ std::memcpy(timestamps_, timestamps, count * sizeof(int64_t));
+ cur_row_size_ = std::max(count, cur_row_size_);
+ return E_OK;
+}
+
+int Tablet::set_column_values(uint32_t schema_index, const void* data,
+ const uint8_t* null_bitmap, uint32_t count) {
Review Comment:
We could add a bulk API like set_column_strings, but it wouldn't provide a
meaningful performance gain over the current per-row add_value approach. Each
string still needs to be individually allocated and copied into the PageArena
via dup_from, so the internal implementation would just be a loop doing the
same work. The bulk interface would only make the call site slightly cleaner,
not faster.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]