feat(argo): dedicated argo-go agent for 星环Argo + statement-splitting and error-reporting fixes - #7933
Conversation
ArgoDB was missing from the backtick branches of quote_table_identifier, quote_transfer_identifier, and is_schema_aware, so generated table-data SQL fell through to the default double-quote form. ArgoDB parses "name" as a string literal, making SELECT * FROM "etl_log" fail with 42000/1101, and unqualified table names dropped the schema prefix.
ArgoDB (Transwarp) accepts PL/SQL-style procedure definitions `CREATE [OR REPLACE] PROCEDURE ... IS BEGIN ... END;` whose body contains semicolons. Without profile-level PL/SQL block protection, the statement splitter emitted one fragment per body statement, so the agent sent only the first fragment (`CREATE ... IS BEGIN INSERT INTO ...`) and the server returned 42000 + vendorCode 1101. Add Argo to the oracle-like database group so it inherits the PL/SQL block detection in the splitter. Add a regression test using the SP_ETL_LOG procedure from the 2026-09-01 screenshot.
…micolon Mirrors the 2026-09-02 user-reported procedure (SP_TEST_PART_A). Splitter must keep the entire PROCEDURE body together even when the body has only one semicolon (after the SELECT expression), not after the INSERT.
…nt splitter The frontend JS splitter (sqlStatementRanges.ts) maintains its own oracle-like PL/SQL database list, mirroring the backend list in dbx-core/src/sql.rs is_oracle_like_database. ArgoDB was missing there, so statement ranges split at every semicolon inside a CREATE [OR REPLACE] PROCEDURE ... IS BEGIN ... END; body: "execute current statement" sent only the first fragment (CREATE ... IS BEGIN INSERT INTO ...) and ArgoDB returned 42000 + vendorCode 1101 — even after the backend splitter was fixed, because the batch progress panel and current-statement extraction both run through this JS copy. Add argo to the frontend set and cover it with the same SP_ETL_LOG regression fixtures the backend tests use (block comments, Chinese line comments, semicolons inside INSERT ... VALUES), plus a statementRangeAtCursor case asserting the whole definition is returned.
…execute errors The ExecuteStatement error path still formatted failures with status.String(), which dumps the raw Thrift struct — pointer fields (SqlState, ErrorMessage) render as Go heap addresses like 0x2c45f4a70e10, hiding the actual server error from users. Route the failure through hiveStatusError like every other call site (open session, metadata, cancel, close, fetch), so errors surface the server's message, SQLState, and error code in readable form.
ArgoDB previously shared the hive-go agent via agentKey: hive, with routine browsing gated on a hardcoded database_type switch inside hive-go. Any upstream cleanup of that switch would silently disable ArgoDB stored-procedure browsing. Fork hive-go into agents/drivers/argo-go serving 星环Argo exclusively: - supportsRoutines() returns true unconditionally: the server family this agent targets always ships system.procedures_v/functions_v, so routine listing no longer depends on hive-go internals. - Connection identity reports ArgoDB (Transwarp) / DBX ArgoDB Go Agent; the Kyuubi/Impala branding branches are replaced by the argo identity. - Tests updated accordingly: routine views are asserted to be queried unconditionally, and connection identity asserts the ArgoDB branding. Wiring changes: - argo.yaml: agentKey argo, label 星环Argo, driverStoreVisible true (order 49, first free slot) so the agent appears in Driver Manager. - agentDriverInstallHint: argo no longer maps to the hive install key; only kyuubi/impala keep sharing hive-go. Vanilla Hive/Kyuubi/Impala behavior on hive-go is unchanged.
- agents: list argo-go in metadata-constraint-coverage.tsv; the common coverage test discovers drivers by their main.go list_objects dispatcher, so the new module must be registered like hive-go. - rust: database_capabilities integration test still asserted agent_key(Argo) == "hive"; argo now owns the dedicated "argo" key. - connection-types: driverStoreOrder 49 collided with the etcd agent's new etcd2 managed driver on main; move 星环Argo to 50 (next free slot).
t8y2
left a comment
There was a problem hiding this comment.
Maintainer patch pushed in 6e99539 (old head 475581b, base main@7e24f4007). Three items from review:
- Ported hive-go's
routineDatabaseCandidatesfix (main 3b2df38) into argo-go —listRoutines/getRoutineSource/getObjectSourcenow accept thedatabaseRPC param and trydatabase→schemabefore falling back to the connection default, and the three pinning regression tests the fork had dropped are restored. Without this, browsing routines under a non-default database would regress to the connection default. - Added the missing release wiring for the
argoagent key:build-argo-nativejob + releaseneeds:in agents-release.yml (plus registry-list/label/log-path entries),argoin bump-agent-versions.mjs native maps,NATIVE_DRIVERS,NATIVE_ONLY_AGENT_MODULES, and the initialagents/versions.jsonentry"argo": "0.1.0"(same pattern as the etcd2 introduction in 72dcd83). CI was green before only because the validator didn't know about argo — the Driver Store entry would have had no downloadable artifact. - Replaced MIGRATION_PARITY.md (a verbatim hive-go Hive 3/4/Kyuubi matrix) with an honest fork note: hive-go fixes touching metadata.go/main.go must be ported here.
Checks run: go vet ./... clean, go test -count=1 ./... green in agents/drivers/argo-go (3 ported tests PASS), python3 agents/scripts/validate_agents.py passes, bump-script evaluation logic exercised without writes, agents-release.yml parses. One known remaining gap (out of scope here): ci.yml has no argo-go job yet — the release workflow's test step covers it for now.
# Conflicts: # .github/scripts/bump-agent-versions.mjs # .github/workflows/agents-release.yml # agents/scripts/version_agent_artifacts.py # agents/versions.json
t8y2
left a comment
There was a problem hiding this comment.
Follow-up maintainer push: merged latest main (717dcc1) into the branch — merge commit b6451c9. The merge re-conflicted only in the release-wiring files because main had since added etcd/etcd2 native entries (72dcd83 lineage) and bumped agent versions, overlapping with this PR's argo wiring. All four hunks resolved as pure unions: main's etcd/etcd2 entries + version bumps kept, argo entries (build job, needs list, registry for-loop, native maps, versions.json "argo": "0.1.0") re-inserted. No behavior choice involved.
Checks: go vet + go test green in agents/drivers/argo-go after the merge; python3 agents/scripts/validate_agents.py passes; versions.json parses (51 keys).
|
Thanks for the contribution! Merged in 24642a6, will be released in the next version. |
Summary
Three related fixes for ArgoDB (Transwarp Inceptor fork of Hive) support:
1.
feat(argo): dedicatedargo-goagent (星环Argo)ArgoDB previously shared the hive-go agent via
agentKey: hive, with routine browsing gated on a hardcodeddatabase_typeswitch inside hive-go (supportsRoutines()). Any upstream cleanup of that switch would silently disable ArgoDB stored-procedure browsing.agents/drivers/hive-gointoagents/drivers/argo-go, serving 星环Argo exclusively:supportsRoutines()unconditionallytrue(the targeted server family always shipssystem.procedures_v/system.functions_v), connection identity reportsArgoDB (Transwarp)/DBX ArgoDB Go Agentargo.yaml:agentKey: argo,label: 星环Argo,driverStoreVisible: true(order 49, first free slot) so the agent appears in Driver ManageragentDriverInstallHint: argo no longer maps to the hive install key; only kyuubi/impala keep sharing hive-go2.
fix(argo): frontend statement splitter kept cutting PL/SQL bodiesThe frontend JS splitter (
sqlStatementRanges.ts) maintains its own oracle-like PL/SQL database list mirroring the backendis_oracle_like_database. ArgoDB was missing there, so statement ranges split at every;inside aCREATE [OR REPLACE] PROCEDURE ... IS BEGIN ... END;body — "execute current statement" and the batch progress panel sent only the first fragment and ArgoDB returned42000 + vendorCode 1101, even with the backend splitter fixed.Adds argo to the frontend set plus regression fixtures mirroring the backend tests (block comments, Chinese line comments, semicolons inside
INSERT ... VALUES, cursor-inside-body case).3.
fix(hive): readable execute errors instead of raw TStatus dumpsThe
ExecuteStatementerror path ingo-common/gohive/hive.gostill usedstatus.String(), which dumps the raw Thrift struct — pointer fields (SqlState,ErrorMessage) render as Go heap addresses like0x2c45f4a70e10. Routes the failure throughhiveStatusErrorlike every other call site, so users see the server's message, SQLState, and error code.Testing
agents/drivers/argo-go:go test ./...green (routine views asserted queried unconditionally; ArgoDB identity asserted)agents/drivers/hive-go+go-common/gohive:go test ./...green (unchanged behavior)sqlStatementRanges.spec.ts198 tests green (incl. 3 new argo cases); connection lib suites 1296 tests green;pnpm typecheckgreencargo test -p dbx-core --lib agent_cataloggreen;make cargo-check-fastgreenCREATE OR REPLACE PROCEDUREexecutes as a single statement, and execute errors surface readable diagnostics