Fix Databricks schema read fallback and error handling - #702
Conversation
… and a failed sync stops hiding the engine's error Signed-off-by: Qishang Zhong <zhongqishang@gmail.com>
… fallback is a failure Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
|
@zhongqishang thanks, and thanks for taking this to a real workspace; the error half is a clear improvement. Before merging I pushed one commit to your branch (504f248) after compiling and running it. Three things changed in the fallback:
In Tests: The next thing a real catalog will hit is separate and existed before your change: schema reads are capped at 201 rows by the chat query limit. That's #703. 🤖 Generated with Claude Code |





Fixes the first two things a real Databricks workspace broke (#241). This engine had only ever been replayed against wiremock.
What went wrong
Refreshing the schema of a mounted source on a live workspace returned
500 Internal server error— and nothing else. The reason Databricks actually gave,[TABLE_OR_VIEW_NOT_FOUND] The table or view \main`.`information_schema`.`columns` cannot be found, existed only in the server log. The statement was the other half:fetch_schemahad exactly one form,.information_schema.columns`.Changes
fetch_schematries the catalog-levelinformation_schema.columns, then falls back tosystem.information_schema.columns WHERE table_catalog = '<catalog>'. When both fail, the error names the forms tried and carries the engine's own words.sync_schemaanswers422 schema_sync_failedwith the engine's message indetailinstead of a bare 500; the code's wording lives in both i18n files.mountis untouched — it already answers 200 withschema_errorset, because the source really is mounted.Verification
cargo fmt --all --checkclean; the release build andtsc --noEmitbehind the deployed image pass.Open question
Why
main.information_schemais unreadable there is not settled: either the token's identity cannot see the catalog (Unity Catalog reports invisible objects as missing), or that catalog is not Unity Catalog managed. The fallback covers the first, and the returneddetailnow tells the two apart on sight.After review (504f248)
sync_schemaresponses:schema_sync_failed(422) covers only a failure to read the engine's schema; our own failures stay 500. The route logs a warning and caps the detail at 600 characters.PERMISSION_DENIEDanswers 422 after one statement.