factorylabs-activewarehouse-etl 0.9.1.2 → 0.9.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +4 -4
- data/lib/etl/engine.rb +2 -2
- data/lib/etl/parser/fixed_width_parser.rb +6 -5
- metadata +1 -2
- data/lib/etl/execution/record.rb +0 -18
data/Rakefile
CHANGED
@@ -72,11 +72,11 @@ module AWETL
|
|
72
72
|
ActiveWarehouse ETL is a pure Ruby Extract-Transform-Load application for loading data into a database.
|
73
73
|
EOF
|
74
74
|
|
75
|
-
s.add_dependency('rake', '>= 0.
|
76
|
-
s.add_dependency('activesupport', '>= 1.
|
77
|
-
s.add_dependency('activerecord', '>= 1.
|
75
|
+
s.add_dependency('rake', '>= 0.8.3')
|
76
|
+
s.add_dependency('activesupport', '>= 2.1.0')
|
77
|
+
s.add_dependency('activerecord', '>= 2.1.0')
|
78
78
|
s.add_dependency('fastercsv', '>= 1.2.0')
|
79
|
-
s.add_dependency('adapter_extensions', '>= 0.
|
79
|
+
s.add_dependency('adapter_extensions', '>= 0.5.0')
|
80
80
|
|
81
81
|
s.rdoc_options << '--exclude' << '.'
|
82
82
|
s.has_rdoc = false
|
data/lib/etl/engine.rb
CHANGED
@@ -470,8 +470,8 @@ module ETL #:nodoc:
|
|
470
470
|
say "Avg transforms: #{Engine.rows_read/benchmarks[:transforms]} rows/sec" if benchmarks[:transforms] > 0
|
471
471
|
say "Avg writes: #{Engine.rows_read/benchmarks[:writes]} rows/sec" if benchmarks[:writes] > 0
|
472
472
|
|
473
|
-
say "Avg time writing execution records: #{ETL::Execution::Record.average_time_spent}"
|
474
|
-
|
473
|
+
# say "Avg time writing execution records: #{ETL::Execution::Record.average_time_spent}"
|
474
|
+
#
|
475
475
|
# ETL::Transform::Transform.benchmarks.each do |klass, t|
|
476
476
|
# say "Avg #{klass}: #{Engine.rows_read/t} rows/sec"
|
477
477
|
# end
|
@@ -13,14 +13,15 @@ module ETL #:nodoc:
|
|
13
13
|
# Return each row
|
14
14
|
def each
|
15
15
|
Dir.glob(file).each do |file|
|
16
|
+
lines_skipped = 0
|
16
17
|
open(file).each do |line|
|
17
18
|
row = {}
|
18
|
-
lines_skipped
|
19
|
+
if lines_skipped < source.skip_lines
|
20
|
+
lines_skipped += 1
|
21
|
+
next
|
22
|
+
end
|
19
23
|
fields.each do |name, f|
|
20
|
-
|
21
|
-
lines_skipped += 1
|
22
|
-
next
|
23
|
-
end
|
24
|
+
|
24
25
|
# TODO make strip optional?
|
25
26
|
row[name] = line[f.field_start, f.field_length].strip
|
26
27
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: factorylabs-activewarehouse-etl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.1.
|
4
|
+
version: 0.9.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anthony Eden
|
@@ -124,7 +124,6 @@ files:
|
|
124
124
|
- lib/etl/execution/batch.rb
|
125
125
|
- lib/etl/execution/job.rb
|
126
126
|
- lib/etl/execution/migration.rb
|
127
|
-
- lib/etl/execution/record.rb
|
128
127
|
- lib/etl/generator/generator.rb
|
129
128
|
- lib/etl/generator/surrogate_key_generator.rb
|
130
129
|
- lib/etl/parser/apache_combined_log_parser.rb
|
data/lib/etl/execution/record.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
module ETL #:nodoc:
|
2
|
-
module Execution #:nodoc:
|
3
|
-
# Represents a single record
|
4
|
-
class Record < ETL::Execution::Base
|
5
|
-
belongs_to :table
|
6
|
-
class << self
|
7
|
-
attr_accessor :time_spent
|
8
|
-
def time_spent
|
9
|
-
@time_spent ||= 0
|
10
|
-
end
|
11
|
-
def average_time_spent
|
12
|
-
return 0 if time_spent == 0
|
13
|
-
ETL::Engine.rows_read / time_spent
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|