Method: ETL::Processor::CheckUniqueProcessor#process

Defined in:
lib/etl/processor/check_unique_processor.rb

#process(row) ⇒ Object

Process the row. This implementation will only return a row if it it’s key combination has not already been seen.

An error will be raised if the row doesn’t include the keys.



28
29
30
31
32
33
34
35
36
# File 'lib/etl/processor/check_unique_processor.rb', line 28

def process(row)
  ensure_columns_available_in_row!(row, keys, 'for unicity check')
  
  key = (keys.collect { |k| row[k] }).join('|')
  unless compound_key_constraints[key]
    compound_key_constraints[key] = 1
    return row
  end
end