fix: void copy when getting json chunk (#43183)

fix: https://github.com/milvus-io/milvus/issues/43182

Signed-off-by: SpadeA <tangchenjie1210@gmail.com>
This commit is contained in:
Spade A 2025-07-08 15:28:46 +08:00 committed by GitHub
parent 8720feeb79
commit d41eec6f10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -90,6 +90,13 @@ class Json {
cap);
}
// WARN: this is used for fast non-copy construction,
// MUST make sure there at least SIMDJSON_PADDING bytes allocated
// after the string_view
explicit Json(const std::string_view& data)
: Json(data.data(), data.size()) {
}
// WARN: this is used for fast non-copy construction,
// MUST make sure that the data points to a memory that
// with size at least len + SIMDJSON_PADDING

View File

@ -196,7 +196,7 @@ class SegmentInternalInterface : public SegmentInterface {
std::vector<Json> res;
res.reserve(string_views.size());
for (const auto& str_view : string_views) {
res.emplace_back(str_view);
res.emplace_back(Json(str_view));
}
return PinWrapper<
std::pair<std::vector<ViewType>, FixedVector<bool>>>(