lib/etl/control/source/database_source.rb
# Write rows to the local cache
Write rows to the local cache
Write rows to the local cache
def write_local(file)
        lines = 0
        t = Benchmark.realtime do
          FasterCSV.open(file, 'w') do |f|
            f << columns
            query_rows.each do |row|
              f << columns.collect { |column| row[column.to_s] }
              lines += 1
            end
          end
          File.open(local_file_trigger(file), 'w') {|f| }
        end
        ETL::Engine.logger.info "Stored locally in #{t}s (avg: #{lines/t} lines/sec)"
      end
def write_local ( file ) lines = 0 t = Benchmark . realtime do FasterCSV . open ( file , 'w' ) do | f | f << columns query_rows . each do | row | f << columns . collect { | column | row [ column . to_s ] } lines += 1 end end File . open ( local_file_trigger ( file ) , 'w' ) { | f | } end ETL :: Engine . logger . info "Stored locally in #{t}s (avg: #{lines/t} lines/sec)" end
Write rows to the local cache
Write rows to the local cache
file
<not_specific>