Skip to content

Commit

Permalink
[chore][format] format vector index code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Haijun Yu committed Apr 15, 2024
1 parent 8f415b9 commit 1e70686
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion scripts/format_code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ BASE_DIR=$(dirname $(cd $(dirname $0); pwd))

find $BASE_DIR/src -name "*.cc" | xargs clang-format -style=file -i
find $BASE_DIR/src -name "*.h" | xargs clang-format -style=file -i

find $BASE_DIR/test -name "*.cc" | xargs clang-format -style=file -i
find $BASE_DIR/test -name "*.h" | xargs clang-format -style=file -i
6 changes: 3 additions & 3 deletions src/client/coordinator_client_function_meta.cc
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ void SendCreateIndex(std::shared_ptr<dingodb::CoordinatorInteraction> coordinato
field->set_field_type(::dingodb::pb::common::ScalarFieldType::DOUBLE);
field->set_enable_speed_up(true);

field = scalar_parameter->add_fields();
field = scalar_parameter->add_fields();
field->set_key("speedup_key_string");
field->set_field_type(::dingodb::pb::common::ScalarFieldType::STRING);
field->set_enable_speed_up(true);
Expand Down Expand Up @@ -996,12 +996,12 @@ void SendCreateIndex(std::shared_ptr<dingodb::CoordinatorInteraction> coordinato
field->set_field_type(::dingodb::pb::common::ScalarFieldType::FLOAT32);
field->set_enable_speed_up(false);

field = scalar_parameter->add_fields();
field = scalar_parameter->add_fields();
field->set_key("key_double");
field->set_field_type(::dingodb::pb::common::ScalarFieldType::DOUBLE);
field->set_enable_speed_up(false);

field = scalar_parameter->add_fields();
field = scalar_parameter->add_fields();
field->set_key("key_string");
field->set_field_type(::dingodb::pb::common::ScalarFieldType::STRING);
field->set_enable_speed_up(false);
Expand Down
7 changes: 3 additions & 4 deletions src/coprocessor/aggregation.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ class Aggregation {
Aggregation(Aggregation&& rhs) = delete;
Aggregation& operator=(Aggregation&& rhs) = delete;

butil::Status Open(
size_t start_aggregation_operators_index,
const std::shared_ptr<std::vector<std::shared_ptr<BaseSchema>>>& result_serial_schemas,
const ::google::protobuf::RepeatedPtrField<pb::store::AggregationOperator>& aggregation_operators);
butil::Status Open(size_t start_aggregation_operators_index,
const std::shared_ptr<std::vector<std::shared_ptr<BaseSchema>>>& result_serial_schemas,
const ::google::protobuf::RepeatedPtrField<pb::store::AggregationOperator>& aggregation_operators);

butil::Status Execute(const std::vector<std::function<bool(const std::any&, std::any*)>>& aggregation_functions,
const std::vector<std::any>& group_by_operator_record);
Expand Down
3 changes: 2 additions & 1 deletion src/vector/vector_index_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ class VectorIndexUtils {
const pb::common::VectorIndexParameter& target);
static butil::Status ValidateVectorIndexParameter(const pb::common::VectorIndexParameter& vector_index_parameter);

[[deprecated("Use another function with the same name")]] static butil::Status ValidateScalarIndexParameter(const pb::common::ScalarIndexParameter& scalar_index_parameter);
[[deprecated("Use another function with the same name")]] static butil::Status ValidateScalarIndexParameter(
const pb::common::ScalarIndexParameter& scalar_index_parameter);

static butil::Status ValidateVectorScalarSchema(const pb::common::ScalarSchema& scalar_schema);

Expand Down
6 changes: 3 additions & 3 deletions test/unit_test/test_vector_index_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -772,9 +772,9 @@ TEST_F(VectorIndexUtilsTest, IsNeedToScanKeySpeedUpCF2) {
// key empty. error.
{
vector_scalar_data.Clear();
//vector_scalar_data.mutable_scalar_data()->insert({"key1", {}});
//vector_scalar_data.mutable_scalar_data()->insert({"key2", {}});
//vector_scalar_data.mutable_scalar_data()->insert({"key3", {}});
// vector_scalar_data.mutable_scalar_data()->insert({"key1", {}});
// vector_scalar_data.mutable_scalar_data()->insert({"key2", {}});
// vector_scalar_data.mutable_scalar_data()->insert({"key3", {}});
vector_scalar_data.mutable_scalar_data()->insert({"", {}});

ok = VectorIndexUtils::IsNeedToScanKeySpeedUpCF(scalar_schema, vector_scalar_data, is_need);
Expand Down

0 comments on commit 1e70686

Please sign in to comment.