Skip to content

SQLSource column name mismatch errors could be clearer about expected vs actual columns #140

@loukratz-bv

Description

@loukratz-bv

Problem

When SQLSource outputs don't match the actual SQL result columns, the error message lists missing columns but doesn't clearly show what was expected vs what was received, making debugging harder.

Reproduction

Given a SQLSource step:

- type: SQLSource
  id: get_products
  connection: "awsathena+rest://..."
  query: |
    SELECT 
      r.about_id as product_id,
      COUNT(*) as review_count
    FROM review r
    GROUP BY r.about_id
  outputs:
    - refined_product_id
    - review_count

Expected Behavior

Clear error message showing:

SQLSource 'get_products' column mismatch:
  Expected outputs: refined_product_id, review_count
  Actual columns:   product_id, review_count
  Missing:          refined_product_id
  Unexpected:       product  Unexpected:       product  Unexpected:       product  Unexpected:       product  Unexpected:       product  Unexpected:       product  Unexpected:       product  Unexpected:       product  Unexpected:       product  Unexpected:       prodtch.

## Impact

- Harder to quickly identify which column alias is wrong
- Especially difficult when multiple columns are mismatched
- Users must manually diff the two comma-separated lists

## Suggested Improvement

Format the error messageFormat th CFormat the errorxpFormat the errorcolFormat the error messageFormat th CFoxpFormat tt nFormat th)
3333333333333333333333333333333in33333333333333333333333333333Su3333333333333333SQL aliases if column names don't match

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions