File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -311,20 +311,16 @@ def unquote(node):
311
311
conditions = C .owner .eq (sge .convert (table_loc .transform (unquote ).sql (dialect )))
312
312
313
313
tables = (
314
- sg .select ("table_name" , "owner" )
315
- .from_ (sg .table ("all_tables" ))
316
- .distinct ()
317
- .where (conditions )
318
- )
319
- views = (
320
- sg .select ("view_name" , "owner" )
321
- .from_ (sg .table ("all_views" ))
314
+ sg .select (C .table_name )
315
+ .from_ ("all_tables" )
322
316
.distinct ()
323
317
.where (conditions )
318
+ .union (
319
+ sg .select (C .view_name ).from_ ("all_views" ).distinct ().where (conditions )
320
+ )
324
321
)
325
- sql = tables .union (views ).sql (dialect )
326
322
327
- with self ._safe_raw_sql (sql ) as cur :
323
+ with self ._safe_raw_sql (tables ) as cur :
328
324
out = cur .fetchall ()
329
325
330
326
return self ._filter_with_like (map (itemgetter (0 ), out ), like )
You can’t perform that action at this time.
0 commit comments