Take a query-history definition draft's tables and columns from the query log
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Start with group_sql in server/knowledge/store/query_history_remote.py, then trace how query-history data reaches the prompt and rests_on through server/memory/app/definition_drafts.py and server/memory/domain/definition_drafts.py. Add the acceptance fixture in tests/integration/test_query_history_drafts.py and check the query-log arrays, capped lists, gap drafts, and one model call per draft.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Company
ClickHouse
Component
Knowledge (documents)
Use case
A definition drafted from query history records the tables and columns it rests on in rests_on. Today the model writes both lists. The draft prompt asks for tables and columns, and the reply is stored after a size check only (server/memory/app/definition_drafts.py, server/memory/domain/definition_drafts.py). The source already knows the answer: system.query_log holds the tables and columns each query read, and the query-history read does not select them (group_sql in server/knowledge/store/query_history_remote.py).
An admin reviewing the draft, or a later check of the definition against its source, reads a list that can name a table the query never touched or omit one it did. rests_on holds the source's normalized SQL beside the model's two lists and does not mark which is which; only the documentation says so (docs/architecture/definition-drafts.md).
Describe the solution you'd like
Read the lists from the source and stop asking the model for them. This is a proposal; nothing is implemented or measured.
group_sqlalso selects thetablesandcolumnsarrays of the query whose text it keeps, each cut to the draft's existing list limits. A cut list is reported as capped, not passed off as complete. The registration probe runs the same statement, so it also verifies that the credential can read the two arrays.- For a query-history draft,
rests_on.tablesandrests_on.columnscome from that read.rests_onrecords where the lists came from, so a reader can tell a source-read list from one written before this change. - The prompt and
DefinitionDraftdroptablesandcolumns. The model still returns the term, aliases and body. - A draft from a knowledge gap has no SQL and no source to read, so it carries no table or column list.
- The read stays inside the registration's database allowlist, which the existing filter on the log's
databasesarray already applies. The lists keep the visibilityrests_onhas today. - The change adds no model call, no table and no statement on the source beyond the existing bounded query-log read.
Acceptance fixture, added to tests/integration/test_query_history_drafts.py:
- A query group over one table yields a draft whose
rests_onlists equal the log's arrays, whatever the model returns. - The model input and the expected reply contain no table or column list.
- A group whose arrays exceed the limits yields cut lists marked capped.
- A query through a view records what the log records for it.
- A gap draft has no lists.
- The model-call count per draft stays at one.
Evidence still needed before this is called a gain:
- A read-only count, on a deployment that has query-history drafts, of the share whose model-written lists differ from the log's arrays for the same query.
- Whether the drafted term, aliases and body change when the prompt stops asking for the two lists. This needs a paired run on fixed query groups, and a paid run only on request.
- What the log's arrays contain for views,
SELECT *and joins on the supported server versions, confirmed in the fixture.
Describe alternatives you've considered
- Parse the normalized SQL in the server. The server imports no SQL parser;
sqlglotis in the extractor's dependency group only. A parser also cannot resolve a view orSELECT *the way the source does. - Keep the model's lists and verify them against
system.columns. That adds a metadata read on the data tables, and registration verifies the query-log read only, not that the credential can see those tables' columns. - Leave it as documented. The lists then stay unusable as evidence for any later check.
Where the need comes from
An AI tool suggested this feature
Additional context
Found by source review; no draft was generated and no source was queried.
Related: #1176 checks maintained guidance against a registered tracker source, with objects a maintainer declares. This change is separate and smaller. It gives query-history definitions a source-read list that a later extension of that check could use. Part of the roadmap in #1232.
- Lingua principale
- Python
- Stelle
- 263
- Fork
- 47
- Merge medio
- 14h 21m
- PR unite (30g)
- 873
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ClickHouse/loom
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 76/100
ClickHouse/loom#2014 ·
I maintainer di solito rispondono entro 1 giorno
-
Options of loom period-digest, reextract, reconcile-status and demote-activity-narration print no help textForse già presa @VanshajPoonia l’ha presa oggi. Apertabug good first issue help wanted up-for-grabs
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
ClickHouse/loom#1988 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
A compiler-tier checkout fetch from a shallow mirror never records its headForse già presa @KaloyanNaumov l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
ClickHouse/loom#2016 ·
I maintainer di solito rispondono entro 1 giorno
-
Delta workers fetch the compiler-tier checkout under a hard-coded 600 s limitForse già presa @KaloyanNaumov l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 35/100
ClickHouse/loom#2012 ·
I maintainer di solito rispondono entro 1 giorno
-
loom participant retire cannot retire an orphaned participant after container replacement or host rebootForse già presa @l0K1ngg l’ha presa oggi. Apertabug help wanted up-for-grabs
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
ClickHouse/loom#2007 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ClickHouse/loom
Issue simili
-
Ubuntu for Debian DevelopersApertaDMB documentation good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
ubuntu/ubuntu-project-docs#921 ·
I maintainer di solito rispondono entro 1 giorno
-
⏳ Pending feedback 🐛 Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
jumpserver/jumpserver#18282 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
accepted
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
future-agi/future-agi#5274 ·
I maintainer di solito rispondono entro 1 giorno
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
GenericMappingTools/pygmt#5014 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno