Sha256: 580ee87c7fbb4b72c805f5ef556f15b9ddb63c5021c1c7b40ac0a21aa9f3a3f1

Contents?: true

Size: 470 Bytes

Versions: 13

Compression:

Stored size: 470 Bytes

Contents

require_relative 'config'

source :sales_items do
  file "sales_items*.csv"
  field :order_id, String
  field :date, Date
  field :customer, Integer
  field :item, String
  field :item_name, String
  field :quantity, Float
  field :c_sales_amount, Float
end

source :products do
  field :item_id
  field :item_name
end


deduplicate :sales_items, into: :products, by: [:item]

# Equivalent to

transform :sales_items => :products do |record|
  deduplicate_by :item
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
cranium-0.8.1 examples/deduplication.rb
cranium-0.8 examples/deduplication.rb
cranium-0.7 examples/deduplication.rb
cranium-0.6.1 examples/deduplication.rb
cranium-0.5 examples/deduplication.rb
cranium-0.4.3 examples/deduplication.rb
cranium-0.4.2 examples/deduplication.rb
cranium-0.4.1 examples/deduplication.rb
cranium-0.4 examples/deduplication.rb
cranium-0.3.1 examples/deduplication.rb
cranium-0.3.0 examples/deduplication.rb
cranium-0.2.1 examples/deduplication.rb
cranium-0.2.0 examples/deduplication.rb