lib/etl/engine.rb
# Called when a batch job finishes, allowing for cleanup to occur
Called when a batch job finishes, allowing for cleanup to occur
Called when a batch job finishes allowing for cleanup to occur
def finish
        temp_tables.each do |temp_table, mapping|
          actual_table = mapping[:table]
          conn = mapping[:connection]
          conn.transaction do
            conn.rename_table(actual_table, "#{actual_table}_old")
            conn.rename_table(temp_table, actual_table)
            conn.drop_table("#{actual_table}_old")
          end
        end
      end
def finish temp_tables . each do | temp_table , mapping | actual_table = mapping [ :table ] conn = mapping [ :connection ] conn . transaction do conn . rename_table ( actual_table , "#{actual_table}_old" ) conn . rename_table ( temp_table , actual_table ) conn . drop_table ( "#{actual_table}_old" ) end end end
Called when a batch job finishes, allowing for cleanup to occur
Called when a batch job finishes allowing for cleanup to occur
#puts "move #{temp_table} to #{actual_table}"