Skip to content

Add tests for v3 SQL generation edge cases#2023

Merged
shangyian merged 4 commits intoDataJunction:mainfrom
shangyian:add-sql-tests
Apr 19, 2026
Merged

Add tests for v3 SQL generation edge cases#2023
shangyian merged 4 commits intoDataJunction:mainfrom
shangyian:add-sql-tests

Conversation

@shangyian
Copy link
Copy Markdown
Collaborator

Summary

This PR adds various tests around v3 SQL gen edge cases:

  • Set-operation transforms: a transform whose body has UNION ALL does not support filter-pushdown today.
  • Added test cases for various transform-query shapes (verifies the shape survives CTE building intact):
    • Derived table in FROM like (FROM (SELECT …)
    • A projected window function (ROW_NUMBER() OVER (…) AS rn)
    • A self-join with multi-condition on clause.
  • Multi-filter composition into one CTE: two filters on the same parent (one via FK-rename, one via a qualified local column) both push into the parent's WHERE without duplication or drop.
  • Three-level metric composition: C = B + A where B is itself derived from two base metrics. The resolution walks all three levels and inlines the full expansion.
  • COALESCE in dimension-link join_sql: both FK columns stay in the parent CTE's projection so the JOIN can evaluate the COALESCE.
  • Duplicate output aliases in a transform: pins the current silent-accept behavior as xfail which will be fixed with unifying validation across the single-node and bulk deployment methods.

Test Plan

  • PR has an associated issue: #
  • make check passes
  • make test shows 100% unit test coverage

Deployment Plan

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 19, 2026

Deploy Preview for thriving-cassata-78ae72 canceled.

Name Link
🔨 Latest commit 607e47e
🔍 Latest deploy log https://app.netlify.com/projects/thriving-cassata-78ae72/deploys/69e4947ca46a5d0008f0b9dc

@shangyian shangyian marked this pull request as ready for review April 19, 2026 09:15
@shangyian shangyian merged commit 24f429b into DataJunction:main Apr 19, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant