Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sqlglot/typing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
},
**{
expr_type: {"annotator": lambda self, e: self._annotate_unary(e)}
for expr_type in subclasses(exp.__name__, (exp.Unary, exp.Alias))
for expr_type in subclasses(
exp.__name__, (exp.Unary, exp.Alias, exp.IgnoreNulls, exp.RespectNulls)
)
},
**{
expr_type: {"returns": exp.DType.BIGINT}
Expand Down
13 changes: 12 additions & 1 deletion tests/fixtures/optimizer/annotate_functions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6375,4 +6375,15 @@ VARCHAR;

# dialect: clickhouse
MD5(tbl.str_col);
FIXEDSTRING(16);
FIXEDSTRING(16);
--------------------------------------
-- IGNORE NULLS / RESPECT NULLS
--------------------------------------

# dialect: spark, databricks, snowflake, bigquery, trino, redshift
FIRST_VALUE(tbl.str_col) IGNORE NULLS;
TEXT;

# dialect: spark, databricks, snowflake, bigquery, trino, redshift
LAST_VALUE(tbl.str_col) RESPECT NULLS;
TEXT;
Loading