Skip to content

Commit 8b9d769

Browse files
committed
feat(tsql)!: Annotate CURRENT_TIMEZONE() for TSQL
1 parent fc55b98 commit 8b9d769

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

sqlglot/typing/tsql.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
exp.Tan,
1919
}
2020
},
21+
exp.CurrentTimezone: {"returns": exp.DataType.Type.VARCHAR},
2122
exp.Radians: {"annotator": lambda self, e: self._annotate_by_args(e, "this")},
2223
}

tests/fixtures/optimizer/annotate_functions.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5540,6 +5540,10 @@ FLOAT;
55405540
ATAN(tbl.float_col);
55415541
FLOAT;
55425542

5543+
# dialect: tsql
5544+
CURRENT_TIMEZONE();
5545+
VARCHAR;
5546+
55435547
--------------------------------------
55445548
-- MySQL
55455549
--------------------------------------

0 commit comments

Comments
 (0)