feat(adbpg): add ADBPG generic search configuration - #832
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: swhhy The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/assign @XuanYang-cn |
|
|
||
| def _render_setup_sql(self, statement: str) -> str: | ||
| """Resolve stable benchmark placeholders in explicitly injected SQL.""" | ||
| return Template(statement).safe_substitute( |
There was a problem hiding this comment.
Medium ---- string.Template treats $$ as an escape and collapses it to a single $. That breaks a common PostgreSQL setup statement such as DO $$ BEGIN ... END $$; before it reaches the server, even though --setup-sql is advertised as accepting SQL. The regression test only covers a named dollar tag ($body$), which safe_substitute happens to leave alone. Please preserve ordinary PostgreSQL dollar-quoted bodies while replacing only the three documented placeholders, and add a DO $$...$$ case.
|
|
||
| class AdbpgIndexConfig(BaseModel, DBCaseConfig): | ||
| metric_type: MetricType | None = None | ||
| benchmark_topk: int = 100 |
There was a problem hiding this comment.
Medium ---- This duplicates the benchmark k with an independent default, but only the direct CLI path copies parameters["k"] into it. Batch/UI/REST tasks keep the real value in TaskConfig.case_config.k, so a run configured with (for example) k=10 still expands $topk to 100 unless the user knows to set this internal field separately. That silently tunes the index/setup SQL for a different workload. Please propagate CaseConfig.k to the ADBPG client for every entry point (or pass it as a normal client argument) instead of maintaining a second default.
|
|
||
| def _split_config_items(values: tuple[str, ...]) -> list[str]: | ||
| """Expand repeatable and comma-separated CLI/YAML values.""" | ||
| return [part.strip() for value in values for part in str(value).split(",") if part.strip()] |
There was a problem hiding this comment.
vectordb_bench/backend/clients/adbpg/options.py line:8
Medium ---- _split_config_items always splits each option value on commas before parsing name=value, so valid comma-valued GUCs such as search_path=foo,bar cannot be expressed: bar is treated as another item and rejected. Because this option is advertised as generic session-GUC support, please either remove the comma shorthand or add an escaping/quoting rule that preserves commas inside values, with a regression test.
This PR adds generic search configuration support for the ADBPG client. Many thanks to the maintainers for taking the time to review and merge this contribution. Your feedback and support are greatly appreciated.