@@ -299,6 +299,66 @@ fn parse_use() {
299299 }
300300}
301301
302+ #[ test]
303+ fn parse_show_catalogs ( ) {
304+ databricks ( ) . verified_stmt ( "SHOW CATALOGS" ) ;
305+ databricks ( ) . verified_stmt ( "SHOW TERSE CATALOGS" ) ;
306+ databricks ( ) . verified_stmt ( "SHOW CATALOGS HISTORY" ) ;
307+ databricks ( ) . verified_stmt ( "SHOW CATALOGS LIKE 'pay*'" ) ;
308+ databricks ( ) . verified_stmt ( "SHOW CATALOGS 'pay*'" ) ;
309+ databricks ( ) . verified_stmt ( "SHOW CATALOGS STARTS WITH 'pay'" ) ;
310+ databricks ( ) . verified_stmt ( "SHOW CATALOGS LIMIT 10" ) ;
311+ databricks ( ) . verified_stmt ( "SHOW CATALOGS HISTORY STARTS WITH 'pay'" ) ;
312+
313+ match databricks ( ) . verified_stmt ( "SHOW CATALOGS LIKE 'pay*'" ) {
314+ Statement :: ShowCatalogs {
315+ terse,
316+ history,
317+ show_options,
318+ } => {
319+ assert ! ( !terse) ;
320+ assert ! ( !history) ;
321+ assert_eq ! ( show_options. show_in, None ) ;
322+ assert_eq ! ( show_options. starts_with, None ) ;
323+ assert_eq ! ( show_options. limit, None ) ;
324+ assert_eq ! ( show_options. limit_from, None ) ;
325+ assert_eq ! (
326+ show_options. filter_position,
327+ Some ( ShowStatementFilterPosition :: Suffix (
328+ ShowStatementFilter :: Like ( "pay*" . to_string( ) )
329+ ) )
330+ ) ;
331+ }
332+ _ => unreachable ! ( ) ,
333+ }
334+ }
335+
336+ #[ test]
337+ fn parse_show_catalogs_with_show_options ( ) {
338+ databricks ( ) . verified_stmt ( "SHOW TERSE CATALOGS HISTORY IN ACCOUNT" ) ;
339+
340+ match databricks ( ) . verified_stmt ( "SHOW TERSE CATALOGS HISTORY IN ACCOUNT" ) {
341+ Statement :: ShowCatalogs {
342+ terse,
343+ history,
344+ show_options,
345+ } => {
346+ assert ! ( terse) ;
347+ assert ! ( history) ;
348+ assert_eq ! ( show_options. filter_position, None ) ;
349+ assert ! ( matches!(
350+ show_options. show_in,
351+ Some ( ShowStatementIn {
352+ parent_type: Some ( ShowStatementInParentType :: Account ) ,
353+ parent_name: None ,
354+ ..
355+ } )
356+ ) ) ;
357+ }
358+ _ => unreachable ! ( ) ,
359+ }
360+ }
361+
302362#[ test]
303363fn parse_databricks_struct_function ( ) {
304364 assert_eq ! (
0 commit comments