Skip to content

Conversation

@fivetran-felixhuang
Copy link
Collaborator

NVL is already implemented. Adding some annotation tests

https://docs.snowflake.com/en/sql-reference/functions/nvl

Platform Supported Argument Type Return Type
Snowflake Yes Any expressions (ideally same type) Type of returned expression
BigQuery No N/A N/A
Redshift Yes Any expressions Determined by compatible input types
PostgreSQL No N/A N/A
Databricks Yes expr1, expr2 (any type) Same type as arguments
DuckDB No N/A N/A
TSQL No N/A N/A

Copy link
Collaborator

@VaggelisD VaggelisD left a comment

Choose a reason for hiding this comment

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

I think I'd keep only 2-3 of these tests and maybe try out what happens if we supply mixed types such as NVL(1, 3.5, ...) etc. Does that work in Snowflake? Would we still annotate it properly?

Comment on lines 2406 to 2397
# dialect: snowflake
NVL('hello', 'fallback');
VARCHAR;

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is tested already from the first test

Suggested change
# dialect: snowflake
NVL('hello', 'fallback');
VARCHAR;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks for pointing this out, let me remove it

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