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
2 changes: 2 additions & 0 deletions sqlglot/typing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@
exp.ArraySlice,
exp.Filter,
exp.LastValue,
exp.Limit,
exp.Order,
exp.SortArray,
exp.Window,
}
Expand Down
40 changes: 40 additions & 0 deletions tests/fixtures/optimizer/annotate_functions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1540,6 +1540,46 @@ STRING;
STRING_AGG(tbl.bin_col);
BINARY;

# dialect: bigquery
STRING_AGG(DISTINCT tbl.str_col);
STRING;

# dialect: bigquery
STRING_AGG(tbl.str_col ORDER BY tbl.str_col);
STRING;

# dialect: bigquery
STRING_AGG(DISTINCT tbl.str_col, ',' ORDER BY tbl.str_col);
STRING;

# dialect: bigquery
STRING_AGG(DISTINCT tbl.bin_col ORDER BY tbl.bin_col);
BINARY;

# dialect: bigquery
STRING_AGG(tbl.str_col, ',' LIMIT 10);
STRING;

# dialect: bigquery
STRING_AGG(tbl.str_col, ',' ORDER BY tbl.str_col LIMIT 10);
STRING;

# dialect: bigquery
STRING_AGG(DISTINCT tbl.str_col, ',' ORDER BY tbl.str_col LIMIT 10);
STRING;

# dialect: bigquery
STRING_AGG(DISTINCT tbl.bin_col ORDER BY tbl.bin_col LIMIT 10);
BINARY;

# dialect: bigquery
ARRAY_AGG(tbl.int_col LIMIT 10);
ARRAY<INT>;

# dialect: bigquery
ARRAY_AGG(DISTINCT tbl.str_col ORDER BY tbl.str_col LIMIT 10);
ARRAY<STRING>;

# dialect: bigquery
DATETIME_TRUNC(DATETIME "2008-12-25 15:30:00", DAY);
DATETIME;
Expand Down