Last active
January 6, 2017 18:35
-
-
Save harlow/743b814f8d8b1d57d9adfcf83e27bfb7 to your computer and use it in GitHub Desktop.
Ruby based ETL pipeline with Iron.io and Redshift
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
# lib/transformers/mixpanel/app_launched_event.rb | |
module Transformers | |
module Mixpanel | |
class AppLaunchEvent | |
def initialize(data) | |
@data = data | |
end | |
def csv_row | |
CSV.generate_line(ordinal_transformed_data) | |
end | |
private | |
def ordinal_transformed_data | |
# transformed data in ordinal column position | |
[ | |
data['customer_id'], | |
device_id, | |
device_platform, | |
data['timestamp'], | |
# ... | |
] | |
end | |
def device_id | |
# Transformation of device identifier | |
end | |
def device_platform | |
# Transformation of device platform | |
end | |
attr_reader :data | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment