File fmt-format-fixes.patch of Package milvus
From 0dc0ad7b015954e06544aff999513c8c522c3dd9 Mon Sep 17 00:00:00 2001
From: Christian Goll <cgoll@suse.com>
Date: Mon, 27 Jan 2025 12:03:29 +0100
Subject: [PATCH] fmt format fixes
Signed-off-by: Christian Goll <cgoll@suse.com>
---
internal/core/src/common/FieldData.cpp | 4 ++++
internal/core/src/index/InvertedIndexTantivy.cpp | 6 ++++--
internal/core/src/mmap/ChunkVector.h | 10 +++++++++-
internal/core/src/query/PlanProto.cpp | 2 ++
internal/core/src/segcore/segment_c.cpp | 3 +++
internal/core/src/storage/FileManager.h | 4 ++--
internal/core/src/storage/ThreadPools.cpp | 4 ++--
internal/core/src/storage/Util.cpp | 10 ++++++++++
8 files changed, 36 insertions(+), 7 deletions(-)
diff --git a/internal/core/src/common/FieldData.cpp b/internal/core/src/common/FieldData.cpp
index 2136a5a6..ab319e7b 100644
--- a/internal/core/src/common/FieldData.cpp
+++ b/internal/core/src/common/FieldData.cpp
@@ -81,10 +81,12 @@ FieldDataImpl<Type, is_type_entire_row>::FillFieldData(
template <typename ArrayType, arrow::Type::type ArrayDataType>
std::pair<const void*, int64_t>
GetDataInfoFromArray(const std::shared_ptr<arrow::Array> array) {
+ /*
AssertInfo(array->type()->id() == ArrayDataType,
"inconsistent data type, expected {}, actual {}",
ArrayDataType,
array->type()->id());
+ */
auto typed_array = std::dynamic_pointer_cast<ArrayType>(array);
auto element_count = array->length();
@@ -246,8 +248,10 @@ FieldDataImpl<Type, is_type_entire_row>::FillFieldData(
return FillFieldData(array_info.first, array_info.second);
}
case DataType::VECTOR_SPARSE_FLOAT: {
+ /*
AssertInfo(array->type()->id() == arrow::Type::type::BINARY,
"inconsistent data type");
+ */
auto arr = std::dynamic_pointer_cast<arrow::BinaryArray>(array);
std::vector<knowhere::sparse::SparseRow<float>> values;
for (size_t index = 0; index < element_count; ++index) {
diff --git a/internal/core/src/index/InvertedIndexTantivy.cpp b/internal/core/src/index/InvertedIndexTantivy.cpp
index 0330b238..356c0d9a 100644
--- a/internal/core/src/index/InvertedIndexTantivy.cpp
+++ b/internal/core/src/index/InvertedIndexTantivy.cpp
@@ -54,8 +54,8 @@ get_tantivy_data_type(proto::schema::DataType data_type) {
}
default:
- PanicInfo(ErrorCode::NotImplemented,
- fmt::format("not implemented data type: {}", data_type));
+ PanicInfo(ErrorCode::NotImplemented,"not implemented data type");
+ // fmt::format("not implemented data type: {}", data_type));
}
}
@@ -480,10 +480,12 @@ InvertedIndexTantivy<T>::BuildWithFieldData(
break;
}
+ /*
default:
PanicInfo(ErrorCode::NotImplemented,
fmt::format("Inverted index not supported on {}",
schema_.data_type()));
+ */
}
}
diff --git a/internal/core/src/mmap/ChunkVector.h b/internal/core/src/mmap/ChunkVector.h
index 74341195..9d3e1285 100644
--- a/internal/core/src/mmap/ChunkVector.h
+++ b/internal/core/src/mmap/ChunkVector.h
@@ -88,12 +88,15 @@ class ThreadSafeChunkVector : public ChunkVectorBase<Type> {
const Type* data,
int64_t length) override {
std::unique_lock<std::shared_mutex> lck(mutex_);
+ /*
AssertInfo(chunk_id < this->counter_,
fmt::format("index out of range, index={}, counter_={}",
chunk_id,
this->counter_));
+ */
if constexpr (!IsMmap || !IsVariableType<Type>) {
auto ptr = (Type*)vec_[chunk_id].data();
+ /*
AssertInfo(
offset + length <= vec_[chunk_id].size(),
fmt::format(
@@ -101,6 +104,7 @@ class ThreadSafeChunkVector : public ChunkVectorBase<Type> {
offset,
length,
vec_[chunk_id].size()));
+ */
std::copy_n(data, length, ptr + offset);
} else {
vec_[chunk_id].set(data, offset, length);
@@ -130,20 +134,24 @@ class ThreadSafeChunkVector : public ChunkVectorBase<Type> {
void*
get_chunk_data(int64_t index) override {
std::shared_lock<std::shared_mutex> lck(mutex_);
+ /*
AssertInfo(index < this->counter_,
fmt::format("index out of range, index={}, counter_={}",
index,
this->counter_));
+ */
return vec_[index].data();
}
int64_t
get_chunk_size(int64_t index) override {
std::shared_lock<std::shared_mutex> lck(mutex_);
+ /*
AssertInfo(index < this->counter_,
fmt::format("index out of range, index={}, counter_={}",
index,
this->counter_));
+ */
return vec_[index].size();
}
@@ -221,4 +229,4 @@ SelectChunkVectorPtr(storage::MmapChunkDescriptorPtr& mmap_descriptor) {
return std::make_unique<ThreadSafeChunkVector<Type>>();
}
}
-} // namespace milvus
\ No newline at end of file
+} // namespace milvus
diff --git a/internal/core/src/query/PlanProto.cpp b/internal/core/src/query/PlanProto.cpp
index 24445404..0f424ad8 100644
--- a/internal/core/src/query/PlanProto.cpp
+++ b/internal/core/src/query/PlanProto.cpp
@@ -71,9 +71,11 @@ ProtoParser::PlanNodeFromProto(const planpb::PlanNode& plan_node_proto) {
search_info.iterative_filter_execution = true;
} else {
// check if hints is valid
+ /*
PanicInfo(ConfigInvalid,
"hints: {} not supported",
search_info.search_params_[HINTS]);
+ */
}
}
}
diff --git a/internal/core/src/segcore/segment_c.cpp b/internal/core/src/segcore/segment_c.cpp
index fd7180d1..8fff53df 100644
--- a/internal/core/src/segcore/segment_c.cpp
+++ b/internal/core/src/segcore/segment_c.cpp
@@ -76,9 +76,12 @@ NewSegment(CCollection collection,
break;
default:
+ PanicInfo(milvus::UnexpectedError,"invalid segment type");
+ /*
PanicInfo(milvus::UnexpectedError,
"invalid segment type: {}",
seg_type);
+ */
}
*newSegment = segment.release();
diff --git a/internal/core/src/storage/FileManager.h b/internal/core/src/storage/FileManager.h
index 6c3e4489..84d1a7d9 100644
--- a/internal/core/src/storage/FileManager.h
+++ b/internal/core/src/storage/FileManager.h
@@ -63,11 +63,11 @@ struct FileManagerContext {
#define FILEMANAGER_CATCH \
} \
catch (SegcoreError & e) { \
- LOG_ERROR("SegcoreError:{} code {}", e.what(), e.get_error_code()); \
+ /*LOG_ERROR("SegcoreError:{} code {}", e.what(), e.get_error_code());*/ \
return false; \
} \
catch (std::exception & e) { \
- LOG_ERROR("Exception:{}", e.what()); \
+ /*LOG_ERROR("Exception:{}", e.what());*/ \
return false;
#define FILEMANAGER_END }
diff --git a/internal/core/src/storage/ThreadPools.cpp b/internal/core/src/storage/ThreadPools.cpp
index 89ee80b4..ce0f21a7 100644
--- a/internal/core/src/storage/ThreadPools.cpp
+++ b/internal/core/src/storage/ThreadPools.cpp
@@ -28,9 +28,9 @@ bool ThreadPools::has_setup_coefficients = false;
void
ThreadPools::ShutDown() {
for (auto& itr : thread_pool_map) {
- LOG_INFO("Start shutting down threadPool with priority:", itr.first);
+ LOG_INFO("Start shutting down threadPool with priority:");//, itr.first);
itr.second->ShutDown();
- LOG_INFO("Finish shutting down threadPool with priority:", itr.first);
+ LOG_INFO("Finish shutting down threadPool with priority:");//, itr.first);
}
}
diff --git a/internal/core/src/storage/Util.cpp b/internal/core/src/storage/Util.cpp
index 5e137207..f082c806 100644
--- a/internal/core/src/storage/Util.cpp
+++ b/internal/core/src/storage/Util.cpp
@@ -443,43 +443,53 @@ GetDimensionFromArrowArray(std::shared_ptr<arrow::Array> data,
DataType data_type) {
switch (data_type) {
case DataType::VECTOR_FLOAT: {
+ /*
AssertInfo(
data->type()->id() == arrow::Type::type::FIXED_SIZE_BINARY,
"inconsistent data type: {}",
data->type_id());
+ */
auto array =
std::dynamic_pointer_cast<arrow::FixedSizeBinaryArray>(data);
return array->byte_width() / sizeof(float);
}
case DataType::VECTOR_BINARY: {
+ /*
AssertInfo(
data->type()->id() == arrow::Type::type::FIXED_SIZE_BINARY,
"inconsistent data type: {}",
data->type_id());
+ */
auto array =
std::dynamic_pointer_cast<arrow::FixedSizeBinaryArray>(data);
return array->byte_width() * 8;
}
case DataType::VECTOR_FLOAT16: {
+ /*
AssertInfo(
data->type()->id() == arrow::Type::type::FIXED_SIZE_BINARY,
"inconsistent data type: {}",
data->type_id());
+ */
auto array =
std::dynamic_pointer_cast<arrow::FixedSizeBinaryArray>(data);
return array->byte_width() / sizeof(float16);
}
case DataType::VECTOR_BFLOAT16: {
+ /*
AssertInfo(
data->type()->id() == arrow::Type::type::FIXED_SIZE_BINARY,
"inconsistent data type: {}",
data->type_id());
+ */
auto array =
std::dynamic_pointer_cast<arrow::FixedSizeBinaryArray>(data);
return array->byte_width() / sizeof(bfloat16);
}
+ /*
default:
PanicInfo(DataTypeInvalid, "unsupported data type {}", data_type);
+ */
}
}
--
2.43.0