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.
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.