Skip to content

feat(argo): dedicated argo-go agent for 星环Argo + statement-splitting and error-reporting fixes - #7933

Merged
t8y2 merged 9 commits into
t8y2:mainfrom
wangfengxiang:fix/argo-quplsql
Sep 2, 2026
Merged

feat(argo): dedicated argo-go agent for 星环Argo + statement-splitting and error-reporting fixes#7933
t8y2 merged 9 commits into
t8y2:mainfrom
wangfengxiang:fix/argo-quplsql

Conversation

@wangfengxiang

Copy link
Copy Markdown
Contributor

Summary

Three related fixes for ArgoDB (Transwarp Inceptor fork of Hive) support:

1. feat(argo): dedicated argo-go agent (星环Argo)

ArgoDB previously shared the hive-go agent via agentKey: hive, with routine browsing gated on a hardcoded database_type switch inside hive-go (supportsRoutines()). Any upstream cleanup of that switch would silently disable ArgoDB stored-procedure browsing.

  • Forks agents/drivers/hive-go into agents/drivers/argo-go, serving 星环Argo exclusively: supportsRoutines() unconditionally true (the targeted server family always ships system.procedures_v/system.functions_v), connection identity reports ArgoDB (Transwarp) / DBX ArgoDB Go Agent
  • 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

2. fix(argo): frontend statement splitter kept cutting PL/SQL bodies

The frontend JS splitter (sqlStatementRanges.ts) maintains its own oracle-like PL/SQL database list mirroring the backend is_oracle_like_database. ArgoDB was missing there, so statement ranges split at every ; inside a CREATE [OR REPLACE] PROCEDURE ... IS BEGIN ... END; body — "execute current statement" and the batch progress panel sent only the first fragment and ArgoDB returned 42000 + 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 dumps

The ExecuteStatement error path in go-common/gohive/hive.go still used status.String(), which dumps the raw Thrift struct — pointer fields (SqlState, ErrorMessage) render as Go heap addresses like 0x2c45f4a70e10. Routes the failure through hiveStatusError like 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)
  • Frontend: sqlStatementRanges.spec.ts 198 tests green (incl. 3 new argo cases); connection lib suites 1296 tests green; pnpm typecheck green
  • Rust: cargo test -p dbx-core --lib agent_catalog green; make cargo-check-fast green
  • End-to-end on a local build: ArgoDB connection shows 星环Argo branding, stored-procedure source opens as one whole statement, CREATE OR REPLACE PROCEDURE executes as a single statement, and execute errors surface readable diagnostics

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.
@github-actions github-actions Bot added area/multiple Touches more than three repository areas dependencies/backend Adds a backend dependency enhancement New feature or request labels Sep 2, 2026
wangfengxiang and others added 2 commits September 2, 2026 21:30
- 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 t8y2 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintainer patch pushed in 6e99539 (old head 475581b, base main@7e24f4007). Three items from review:

  1. Ported hive-go's routineDatabaseCandidates fix (main 3b2df38) into argo-go — listRoutines/getRoutineSource/getObjectSource now accept the database RPC param and try databaseschema before 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.
  2. Added the missing release wiring for the argo agent key: build-argo-native job + release needs: in agents-release.yml (plus registry-list/label/log-path entries), argo in bump-agent-versions.mjs native maps, NATIVE_DRIVERS, NATIVE_ONLY_AGENT_MODULES, and the initial agents/versions.json entry "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.
  3. 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 t8y2 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@t8y2
t8y2 merged commit 24642a6 into t8y2:main Sep 2, 2026
13 of 14 checks passed
@t8y2

t8y2 commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Thanks for the contribution! Merged in 24642a6, will be released in the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/multiple Touches more than three repository areas dependencies/backend Adds a backend dependency enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants