Skip to content

Commit 5922ba6

Browse files
authored
feat(tsql)!: Annotate inverse trigonometric functions for TSQL (#6865)
* feat(tsql)!: Annotate inverse trigonometric functions for TSQL * A-Z order
1 parent eb9887f commit 5922ba6

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

sqlglot/typing/tsql.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
**{
99
expr_type: {"returns": exp.DataType.Type.FLOAT}
1010
for expr_type in {
11+
exp.Acos,
12+
exp.Asin,
13+
exp.Atan,
14+
exp.Atan2,
1115
exp.Cos,
1216
exp.Cot,
1317
exp.Sin,

tests/fixtures/optimizer/annotate_functions.sql

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5500,6 +5500,46 @@ FLOAT;
55005500
COT(tbl.float_col);
55015501
FLOAT;
55025502

5503+
# dialect: tsql
5504+
ATN2(tbl.int_col, tbl.int_col);
5505+
FLOAT;
5506+
5507+
# dialect: tsql
5508+
ATN2(tbl.int_col, tbl.float_col);
5509+
FLOAT;
5510+
5511+
# dialect: tsql
5512+
ATN2(tbl.float_col, tbl.int_col);
5513+
FLOAT;
5514+
5515+
# dialect: tsql
5516+
ATN2(tbl.float_col, tbl.float_col);
5517+
FLOAT;
5518+
5519+
# dialect: tsql
5520+
ASIN(tbl.int_col);
5521+
FLOAT;
5522+
5523+
# dialect: tsql
5524+
ASIN(tbl.float_col);
5525+
FLOAT;
5526+
5527+
# dialect: tsql
5528+
ACOS(tbl.int_col);
5529+
FLOAT;
5530+
5531+
# dialect: tsql
5532+
ACOS(tbl.float_col);
5533+
FLOAT;
5534+
5535+
# dialect: tsql
5536+
ATAN(tbl.int_col);
5537+
FLOAT;
5538+
5539+
# dialect: tsql
5540+
ATAN(tbl.float_col);
5541+
FLOAT;
5542+
55035543
--------------------------------------
55045544
-- MySQL
55055545
--------------------------------------

0 commit comments

Comments
 (0)