jayzes-activewarehouse-etl 0.9.1 → 0.9.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -59,10 +59,10 @@ module ETL #:nodoc:
|
|
59
59
|
names = []
|
60
60
|
values = []
|
61
61
|
order.each do |name|
|
62
|
-
names << name
|
62
|
+
names << "`#{name}`"
|
63
63
|
values << conn.quote(row[name]) # TODO: this is probably not database agnostic
|
64
64
|
end
|
65
|
-
q = "INSERT INTO
|
65
|
+
q = "INSERT INTO `#{table_name}` (#{names.join(',')}) VALUES (#{values.join(',')})"
|
66
66
|
ETL::Engine.logger.debug("Executing insert: #{q}")
|
67
67
|
conn.insert(q, "Insert row #{current_row}")
|
68
68
|
@current_row += 1
|
@@ -0,0 +1,18 @@
|
|
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
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jayzes-activewarehouse-etl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.1
|
4
|
+
version: 0.9.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anthony Eden
|
@@ -124,6 +124,7 @@ 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
|
127
128
|
- lib/etl/generator/generator.rb
|
128
129
|
- lib/etl/generator/surrogate_key_generator.rb
|
129
130
|
- lib/etl/parser/apache_combined_log_parser.rb
|