Skip to content

Commit 587196c

Browse files
feat(optimizer)!: Annotate type for snowflake STRTOK_TO_ARRAY function (#5994)
* feat(optimizer): Annotate type for snowflake STRTOK_TO_ARRAY function * fix: Updated tests
1 parent b6f9694 commit 587196c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

sqlglot/dialects/snowflake.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,7 @@ class Snowflake(Dialect):
591591
exp.DataType.Type.ARRAY: {
592592
exp.Split,
593593
exp.RegexpExtractAll,
594+
exp.StringToArray,
594595
},
595596
exp.DataType.Type.OBJECT: {
596597
exp.ParseUrl,

tests/fixtures/optimizer/annotate_functions.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2187,6 +2187,10 @@ BOOLEAN;
21872187
STARTSWITH(tbl.bin_col, NULL);
21882188
BOOLEAN;
21892189

2190+
# dialect: snowflake
2191+
STRTOK_TO_ARRAY('a,b,c', ',');
2192+
ARRAY;
2193+
21902194
# dialect: snowflake
21912195
SUBSTR('hello world', 1, 5);
21922196
VARCHAR;

0 commit comments

Comments
 (0)