Skip to content

Conversation

@fivetran-ashashankar
Copy link
Collaborator

No description provided.

@fivetran-ashashankar fivetran-ashashankar force-pushed the RD-1051981-annotate-type-for-CASE-function branch from 68d3d22 to 78ac69a Compare October 28, 2025 22:16
@fivetran-ashashankar fivetran-ashashankar changed the title annotate types for CASE function test(snowflake): add tests for CASE expression type annotation Oct 28, 2025
Copy link
Collaborator

@georgesittas georgesittas left a comment

Choose a reason for hiding this comment

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

Discussed in Slack– let's ensure this test is included before merging:

-- Should result in an integer type
CASE WHEN score >= 90 THEN 100 ELSE NULL END;

It appears that this is currently annotated as UNKNOWN an we're looking into it.

fix: handle NULL correctly in _maybe_coerce
@fivetran-ashashankar
Copy link
Collaborator Author

modified _maybe_coerce to coerce NULLs properly.
The type of a CASE expression (or any expression) that includes NULL should be the type of the non-null branches.

@fivetran-ashashankar fivetran-ashashankar marked this pull request as ready for review October 30, 2025 17:58
@georgesittas georgesittas merged commit e7ddad1 into main Oct 30, 2025
7 checks passed
@georgesittas georgesittas deleted the RD-1051981-annotate-type-for-CASE-function branch October 30, 2025 18:20
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.

3 participants