Skip to content

Instantly share code, notes, and snippets.

@umar-webonise
Created July 2, 2015 04:32
Show Gist options
  • Save umar-webonise/ce46679c111854a164c8 to your computer and use it in GitHub Desktop.
Save umar-webonise/ce46679c111854a164c8 to your computer and use it in GitHub Desktop.
A way to handle aggregation
source CsvSource, {"type"=>"csv", "file"=>{"path"=>"/home/webonise/Projects/Data-Integration/dump/users.csv"}, "options"=>{"col_sep"=>";"}}
transform RenameField, {"from"=>"euro", "to"=>"amount_euro"}
destination AggregateFieldsDestination,{ 'file' => { 'path' =>'dump/1435811412.csv'}, 'options' => {"group_by"=>["name"], "sum"=>"amount_euro"} }
source CsvSource,{ 'file' => { 'path' => 'dump/1435811412.csv' },'options' => {'col_sep' => ',' } }
transform RenameField, {"from"=>"amount_euro", "to"=>"euro"}
destination CsvDestination, {"type"=>"csv", "file"=>{"path"=>"/home/webonise/Projects/Data-Integration/dump/order.csv"}, "options"=>{"col_sep"=>",", "output_fields"=>["name", "amount_euro"]}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment