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
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ dependencies = [
"environs",
"pydantic<v2",
"scikit-learn",
"pymilvus", # with pandas, numpy, ujson
"pymilvus", # with pandas, numpy
"hdrhistogram>=0.10.1",
"ujson",
]
dynamic = ["version"]

Expand Down
8 changes: 4 additions & 4 deletions vectordb_bench/backend/clients/polardb/polardb.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ def init(self):
db_name = self.db_config["database"]
hint = "/*+ SET_VAR(imci_enable_fast_vector_search=on) */"

self.insert_sql = f"INSERT INTO {db_name}.{self.table_name} (id, v) VALUES (%s, _binary %s)" # noqa: S608
self.insert_sql = f"INSERT INTO {db_name}.{self.table_name} (id, v) VALUES (%s, _binary %s)"
self.select_sql = (
f"SELECT {hint} id FROM {db_name}.{self.table_name} " # noqa: S608
f"SELECT {hint} id FROM {db_name}.{self.table_name} "
f"ORDER BY DISTANCE(v, _binary %s, '{metric_type}') "
f"LIMIT %s"
)
self.select_sql_with_filter = (
f"SELECT id FROM {db_name}.{self.table_name} " # noqa: S608
f"SELECT id FROM {db_name}.{self.table_name} "
f"WHERE id >= %s "
f"ORDER BY DISTANCE(v, _binary %s, '{metric_type}') "
f"LIMIT %s"
Expand Down Expand Up @@ -218,7 +218,7 @@ def _insert_batch(self, embeddings: list[list[float]], metadata: list[int], offs
conn, cursor = self._create_connection()
try:
db_name = self.db_config["database"]
insert_sql = f"INSERT INTO {db_name}.{self.table_name} (id, v) VALUES (%s, _binary %s)" # noqa: S608
insert_sql = f"INSERT INTO {db_name}.{self.table_name} (id, v) VALUES (%s, _binary %s)"
batch_data = []
for i in range(offset, offset + size):
batch_data.append((int(metadata[i]), self.vector_to_hex(embeddings[i])))
Expand Down
Loading