@@ -71,7 +71,9 @@ def run_middle_out(self):
71
71
start_time = time .time ()
72
72
for idx , t in enumerate (passthrough_tables ):
73
73
print_progress (t , idx + 1 , len (passthrough_tables ))
74
- q = 'SELECT * FROM {} LIMIT {}' .format (fully_qualified_table (t ), config_reader .get_max_rows_per_table ())
74
+ q = 'SELECT * FROM {}' .format (fully_qualified_table (t ))
75
+ if config_reader .get_max_rows_per_table () is not None :
76
+ q += 'LIMIT {}' .format (config_reader .get_max_rows_per_table ())
75
77
self .__db_helper .copy_rows (self .__source_conn , self .__destination_conn , q , mysql_db_name_hack (t , self .__destination_conn ))
76
78
print ('Pass-through completed in {}s' .format (time .time ()- start_time ))
77
79
@@ -140,7 +142,8 @@ def __subset_upstream(self, target, processed_tables, relationships):
140
142
clauses .extend (upstream_filter_match (target , table_columns ))
141
143
142
144
select_query = 'SELECT * FROM {} WHERE TRUE AND {}' .format (quoter (temp_target_name ), ' AND ' .join (clauses ))
143
- select_query += " LIMIT {}" .format (config_reader .get_max_rows_per_table ())
145
+ if config_reader .get_max_rows_per_table () is not None :
146
+ select_query += " LIMIT {}" .format (config_reader .get_max_rows_per_table ())
144
147
insert_query = 'INSERT INTO {} {}' .format (fully_qualified_table (mysql_db_name_hack (target , self .__destination_conn )), select_query )
145
148
self .__db_helper .run_query (insert_query , self .__destination_conn )
146
149
self .__destination_conn .commit ()
0 commit comments