@@ -187,6 +187,15 @@ impl Dialect for SnowflakeDialect {
187
187
return Some ( parse_file_staging_command ( kw, parser) ) ;
188
188
}
189
189
190
+ if parser. parse_keyword ( Keyword :: SHOW ) {
191
+ let terse = parser. parse_keyword ( Keyword :: TERSE ) ;
192
+ if parser. parse_keyword ( Keyword :: OBJECTS ) {
193
+ return Some ( parse_show_objects ( terse, parser) ) ;
194
+ }
195
+ }
196
+
197
+
198
+
190
199
None
191
200
}
192
201
@@ -264,7 +273,7 @@ impl Dialect for SnowflakeDialect {
264
273
fn is_select_item_alias ( & self , explicit : bool , kw : & Keyword , parser : & mut Parser ) -> bool {
265
274
explicit
266
275
|| match kw {
267
- // The following keywords can be considered an alias as long as
276
+ // The following keywords can be considered an alias as long as
268
277
// they are not followed by other tokens that may change their meaning
269
278
// e.g. `SELECT * EXCEPT (col1) FROM tbl`
270
279
Keyword :: EXCEPT
@@ -286,8 +295,8 @@ impl Dialect for SnowflakeDialect {
286
295
false
287
296
}
288
297
289
- // Reserved keywords by the Snowflake dialect, which seem to be less strictive
290
- // than what is listed in `keywords::RESERVED_FOR_COLUMN_ALIAS`. The following
298
+ // Reserved keywords by the Snowflake dialect, which seem to be less strictive
299
+ // than what is listed in `keywords::RESERVED_FOR_COLUMN_ALIAS`. The following
291
300
// keywords were tested with the this statement: `SELECT 1 <KW>`.
292
301
Keyword :: FROM
293
302
| Keyword :: GROUP
@@ -966,7 +975,7 @@ fn parse_session_options(parser: &mut Parser, set: bool) -> Result<Vec<DataLoadi
966
975
} ) ;
967
976
Ok ( ( ) )
968
977
}
969
-
978
+
970
979
} ,
971
980
_ => parser. expected ( "another option" , parser. peek_token ( ) ) ,
972
981
} ?;
@@ -1115,3 +1124,15 @@ fn parse_column_tags(parser: &mut Parser, with: bool) -> Result<TagsColumnOption
1115
1124
1116
1125
Ok ( TagsColumnOption { with, tags } )
1117
1126
}
1127
+
1128
+ /// Parse snowflake show objects.
1129
+ /// <https://docs.snowflake.com/en/sql-reference/sql/show-objects>
1130
+ fn parse_show_objects ( terse : bool , parser : & mut Parser ) -> Result < Statement , ParserError > {
1131
+ let show_options = parser. parse_show_stmt_options ( ) ?;
1132
+ Ok (
1133
+ Statement :: ShowObjects {
1134
+ terse,
1135
+ show_options,
1136
+ }
1137
+ )
1138
+ }
0 commit comments