Skip to content

Commit

Permalink
Reduce duplicated VectorIndexKind and VectorDistanceMetric definitions
Browse files Browse the repository at this point in the history
Signed-off-by: Wish <[email protected]>
  • Loading branch information
breezewish committed Mar 21, 2024
1 parent 55a7867 commit 83392dc
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions proto/executor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,19 @@ enum EngineType {
TiFlash = 2;
}

enum ANNQueryDistanceMetric {
InvalidMetric = 0;
// Note: The name of the enum is intentionally aligned with tidb/parser/index_vector.go.
enum VectorIndexKind {
INVALID_INDEX_KIND = 0;
HNSW = 1;
}

// Note: The name of the enum is intentionally aligned with tidb/parser/index_vector.go.
enum VectorDistanceMetric {
INVALID_DISTANCE_METRIC = 0;
L1 = 1;
L2 = 2;
Cosine = 3;
InnerProduct = 4;
COSINE = 3;
INNER_PRODUCT = 4;
}

enum ANNQueryType {
Expand All @@ -117,7 +124,7 @@ enum ANNQueryType {
// ANN = Approximate Nearest Neighbor. For some queries, ANN index can be used.
message ANNQueryInfo {
optional ANNQueryType query_type = 1 [(gogoproto.nullable) = false];
optional ANNQueryDistanceMetric distance_metric = 2 [(gogoproto.nullable) = false];
optional VectorDistanceMetric distance_metric = 2 [(gogoproto.nullable) = false];
optional uint32 top_k = 3 [(gogoproto.nullable) = false];
optional string column_name = 4 [(gogoproto.nullable) = false]; // For debug purpose only. Currently only used in explain.
optional int64 column_id = 5 [(gogoproto.nullable) = false];
Expand Down

0 comments on commit 83392dc

Please sign in to comment.