altimate-code icon indicating copy to clipboard operation
altimate-code copied to clipboard

dbt tool regression: silent failures, schema format inconsistencies, wrong results

Open anandgupta42 opened this issue 8 months ago • 0 comments

Ran a comprehensive test of 30+ dbt-related tools against the jaffle_shop-altimate project (DuckDB backend, dbt 1.8.7). Found 5 broken tools and 6 degraded tools out of 31 tested.

Broken Tools (❌)

  1. sql_rewrite — Failed to parse JSON schema: missing field 'tables'. Schema format expects {tables: ...} wrapper but docs/other tools use flat {table: {col: type}}.
  2. lineage_check — Same schema format error: missing field 'tables'.
  3. altimate_core_fix — "Could not auto-fix the SQL" for an obvious asdas stray alias (order_id as order_id asdas). Should be trivially fixable.
  4. altimate_core_rewrite — "No rewrites suggested" for a SELECT * query with schema_context provided. Should have expanded the wildcard.
  5. altimate_core_schema_diff — Returns "Schemas are identical" when comparing schemas with dropped columns (first_name, last_name) and added columns (full_name, phone). Correctness bug.

Degraded Tools (⚠️)

  1. sql_analyze — "Analysis failed: Unknown error" with no details. Core analysis tool is silently failing.
  2. altimate_core_validate — Returns "Validation failed:" with empty message body.
  3. altimate_core_grade — Returns "Grade: undefined" instead of an A-F score.
  4. altimate_core_column_lineage — "No column lineage edges found" for valid multi-join SQL with schema_context.
  5. altimate_core_testgen — "No test cases generated" for a GROUP BY query that should produce boundary/NULL tests.
  6. altimate_core_complete — "No completions available" with valid prefix and schema_context.

Root Cause Patterns

  • Schema format inconsistency: sql_rewrite and lineage_check expect Rust-engine format ({tables: ...}), while altimate_core_* tools accept flat format. This is a DX footgun.
  • Silent failures: sql_analyze, altimate_core_validate, and altimate_core_grade fail without actionable error messages.
  • AltimateCore Rust engine: Several core functions (column_lineage, testgen, complete, schema_diff, fix) return empty/wrong results — suggesting the Rust engine may not be fully wired up for all inputs.

Steps to Replicate

  1. Load jaffle_shop-altimate dbt project with DuckDB
  2. Run sql_analyze on any valid compiled SQL → "Unknown error"
  3. Run altimate_core_schema_diff with schema1_context = {"customers": {"customer_id": "INTEGER", "first_name": "VARCHAR", "last_name": "VARCHAR", "email": "VARCHAR"}} and schema2_context = {"customers": {"customer_id": "INTEGER", "full_name": "VARCHAR", "email": "VARCHAR", "phone": "VARCHAR"}} → incorrectly returns "Schemas are identical"
  4. Run lineage_check with flat schema_context → schema parse error

Working Tools (20/31)

sql_optimize, sql_format, sql_translate, altimate_core_check, altimate_core_equivalence, altimate_core_compare, altimate_core_extract_metadata, altimate_core_migration, altimate_core_import_ddl, altimate_core_semantics, dbt_manifest, dbt_profiles, dbt_lineage, altimate_memory_*, training_*, dbt CLI.


Metadata

Field Value
CLI Version 0.0.0-worktree-fix/trest-local-202603181439
Platform darwin
Architecture arm64
OS Release 24.6.0
Category bug
Working Directory anandgupta
Session ID ses_2fe984384ffeTDEu16q1motgO4

anandgupta42 avatar Mar 18 '26 14:03 anandgupta42