Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions src/db/index/common/schema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ Status FieldSchema::validate() const {
support_dense_vector_index.end()) {
return Status::InvalidArgument(
"schema validate failed: dense_vector's index_params only "
"support FLAT|HNSW "
"index, "
"but field[",
"support FLAT|HNSW|IVF index, but field[",
name_, "]'s index_type is ",
IndexTypeCodeBook::AsString(index_params_->type()));
}
Expand Down Expand Up @@ -199,15 +197,23 @@ std::string FieldSchema::to_string() const {

std::string FieldSchema::to_string_formatted(int indent_level) const {
std::ostringstream oss;
oss << indent(indent_level) << "FieldSchema{\n"
<< indent(indent_level + 1) << "name: '" << name_ << "',\n"
<< indent(indent_level + 1)
<< "data_type: " << DataTypeCodeBook::AsString(data_type_) << ",\n"
if (is_vector_field()) {
oss << indent(indent_level) << "FieldSchema[vector]{\n";
} else {
oss << indent(indent_level) << "FieldSchema[scalar]{\n";
}

oss << indent(indent_level + 1) << "name: '" << name_ << "',\n"
<< indent(indent_level + 1)
<< "nullable: " << (nullable_ ? "true" : "false") << ",\n";
<< "data_type: " << DataTypeCodeBook::AsString(data_type_) << ",\n";

if (dimension_ != 0) {
oss << indent(indent_level + 1) << "dimension: " << dimension_ << ",\n";
if (is_vector_field()) {
if (is_dense_vector()) {
oss << indent(indent_level + 1) << "dimension: " << dimension_ << ",\n";
}
} else {
oss << indent(indent_level + 1)
<< "nullable: " << (nullable_ ? "true" : "false") << ",\n";
}

if (index_params_) {
Expand Down
6 changes: 6 additions & 0 deletions src/db/index/common/type_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,12 @@ struct DataTypeCodeBook {
case DataType::VECTOR_INT16:
data_type = "VECTOR_INT16";
break;
case DataType::SPARSE_VECTOR_FP16:
data_type = "SPARSE_VECTOR_FP16";
break;
case DataType::SPARSE_VECTOR_FP32:
data_type = "SPARSE_VECTOR_FP32";
break;
case DataType::ARRAY_BINARY:
data_type = "ARRAY_BINARY";
break;
Expand Down
3 changes: 1 addition & 2 deletions src/include/zvec/db/index_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,7 @@ class IVFIndexParams : public VectorIndexParams {
auto base_str = vector_index_params_to_string("IVFIndexParams",
metric_type_, quantize_type_);
std::ostringstream oss;
oss << base_str << ",n_list:" << n_list_ << ",n_iters:" << n_iters_
<< ",use_soar:" << use_soar_ << " << ";
oss << base_str << ",n_list:" << n_list_ << ",n_iters:" << n_iters_ << "}";
return oss.str();
}

Expand Down