File tree Expand file tree Collapse file tree 1 file changed +1
-16
lines changed
Expand file tree Collapse file tree 1 file changed +1
-16
lines changed Original file line number Diff line number Diff line change @@ -513,26 +513,11 @@ def ctas_query(self, **render_kwarg: t.Any) -> exp.Query:
513513 Return:
514514 The mocked out ctas query.
515515 """
516- query = self .render_query_or_raise (** render_kwarg ).copy ( )
516+ query = self .render_query_or_raise (** render_kwarg ).limit ( 0 )
517517
518518 for select_or_set_op in query .find_all (exp .Select , exp .SetOperation ):
519- skip_limit = False
520- ancestor = select_or_set_op .parent
521- while ancestor and not skip_limit :
522- if isinstance (ancestor , exp .With ) and ancestor .recursive :
523- skip_limit = True
524- ancestor = ancestor .parent
525-
526519 if isinstance (select_or_set_op , exp .Select ) and select_or_set_op .args .get ("from" ):
527520 select_or_set_op .where (exp .false (), copy = False )
528- if not skip_limit and not isinstance (select_or_set_op .parent , exp .SetOperation ):
529- select_or_set_op .limit (0 , copy = False )
530- elif (
531- not skip_limit
532- and isinstance (select_or_set_op , exp .SetOperation )
533- and not isinstance (select_or_set_op .parent , exp .SetOperation )
534- ):
535- select_or_set_op .set ("limit" , exp .Limit (expression = exp .Literal .number (0 )))
536521
537522 if self .managed_columns :
538523 query .select (
You can’t perform that action at this time.
0 commit comments