lib/etl/control/source/database_source.rb
# Read rows from the local cache
Read rows from the local cache
Read rows from the local cache
def read_rows(file)
        raise "Local cache file not found" unless File.exists?(file)
        raise "Local cache trigger file not found" unless File.exists?(local_file_trigger(file))
        t = Benchmark.realtime do
          FasterCSV.open(file, :headers => true).each do |row|
            result_row = ETL::Row.new
            result_row.source = self
            row.each do |header, field|
              result_row[header.to_sym] = field
            end
            yield result_row
          end
        end
        ETL::Engine.average_rows_per_second = ETL::Engine.rows_read / t
      end
def read_rows ( file ) raise "Local cache file not found" unless File . exists? ( file ) raise "Local cache trigger file not found" unless File . exists? ( local_file_trigger ( file ) ) t = Benchmark . realtime do FasterCSV . open ( file , :headers => true ) . each do | row | result_row = ETL :: Row . new result_row . source = self row . each do | header , field | result_row [ header . to_sym ] = field end yield result_row end end ETL :: Engine . average_rows_per_second = ETL :: Engine . rows_read / t end
Read rows from the local cache
Read rows from the local cache
file
<not_specific>