forked from activewarehouse/activewarehouse-etl
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Joel
committed
May 4, 2011
1 parent
3fc33e3
commit 0d559dd
Showing
9 changed files
with
139 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Bob,Smith,200 South Drive,Boston,MA,32123 | ||
Bob,Smith,200 South Drive,Boston,MA,32123,2010-05-01 12:45:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Bob,Smith,1010 SW 23rd St,Los Angeles,CA,90392 | ||
Bob,Smith,1010 SW 23rd St,Los Angeles,CA,90392,2010-05-02 12:45:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Bob,Smith,280 Pine Street,Los Angeles,CA,90392 | ||
Bob,Smith,280 Pine Street,Los Angeles,CA,90392,2010-05-03 12:45:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
source :in, { | ||
:file => "scd/#{ENV['run_number']}.txt", | ||
:parser => :delimited | ||
}, | ||
[ | ||
:first_name, | ||
:last_name, | ||
:address, | ||
:city, | ||
:state, | ||
:zip_code, | ||
:date | ||
] | ||
|
||
destination :out, { | ||
:file => 'output/scd_test_type_2_row_timestamp.txt', | ||
:natural_key => [:first_name, :last_name], | ||
:scd => { | ||
:type => 2, | ||
:merge_nils => true, | ||
:timestamp => :date, | ||
:dimension_target => :data_warehouse, | ||
:dimension_table => 'person_dimension' | ||
}, | ||
:scd_fields => ENV['type_2_scd_fields'] ? Marshal.load(ENV['type_2_scd_fields']) : [:address, :city, :state, :zip_code] | ||
}, | ||
{ | ||
:order => [ | ||
:id, :first_name, :last_name, :address, :city, :state, :zip_code, :effective_date, :end_date, :latest_version | ||
], | ||
:virtual => { | ||
:id => ETL::Generator::SurrogateKeyGenerator.new(:target => :data_warehouse, :table => 'person_dimension') | ||
} | ||
} | ||
|
||
post_process :bulk_import, { | ||
:file => 'output/scd_test_type_2_row_timestamp.txt', | ||
:target => :data_warehouse, | ||
:table => 'person_dimension' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
source :in, { | ||
:file => "scd/#{ENV['run_number']}.txt", | ||
:parser => :delimited | ||
}, | ||
[ | ||
:first_name, | ||
:last_name, | ||
:address, | ||
:city, | ||
:state, | ||
:zip_code, | ||
:date | ||
] | ||
|
||
destination :out, { | ||
:file => 'output/scd_test_type_2_specific_timestamp.txt', | ||
:natural_key => [:first_name, :last_name], | ||
:scd => { | ||
:type => 2, | ||
:merge_nils => true, | ||
:timestamp => Time.now - 1.day, | ||
:dimension_target => :data_warehouse, | ||
:dimension_table => 'person_dimension' | ||
}, | ||
:scd_fields => ENV['type_2_scd_fields'] ? Marshal.load(ENV['type_2_scd_fields']) : [:address, :city, :state, :zip_code] | ||
}, | ||
{ | ||
:order => [ | ||
:id, :first_name, :last_name, :address, :city, :state, :zip_code, :effective_date, :end_date, :latest_version | ||
], | ||
:virtual => { | ||
:id => ETL::Generator::SurrogateKeyGenerator.new(:target => :data_warehouse, :table => 'person_dimension') | ||
} | ||
} | ||
|
||
post_process :bulk_import, { | ||
:file => 'output/scd_test_type_2_specific_timestamp.txt', | ||
:target => :data_warehouse, | ||
:table => 'person_dimension' | ||
} |