lib/rocket_job/sliced/input.rb in rocketjob-4.1.0 vs lib/rocket_job/sliced/input.rb in rocketjob-4.1.1
- old
+ new
@@ -105,11 +105,10 @@
block ||= -> (io) do
iterator = "each_#{stream_mode}".to_sym
IOStreams.public_send(iterator, file_name_or_io, encoding: encoding, **args) { |line| io << line }
end
- create_indexes
Writer::Input.collect(self, on_first: on_first, &block)
end
# Upload the result of a MongoDB query to the input collection for processing
# Useful when an entire MongoDB collection, or part thereof needs to be
@@ -139,11 +138,10 @@
#
# Example: Upload just the supplied column
# criteria = User.where(state: 'FL')
# job.record_count = job.upload_mongo_query(criteria, :zip_code)
def upload_mongo_query(criteria, *column_names, &block)
- create_indexes
options = criteria.options
# Without a block extract the fields from the supplied criteria
if block
# Criteria is returning old school :fields instead of :projections
@@ -196,10 +194,9 @@
#
# Example: Upload user_name and zip_code
# arel = User.where(country_code: 'US')
# job.record_count = job.upload_arel(arel, :user_name, :zip_code)
def upload_arel(arel, *column_names, &block)
- create_indexes
unless block
column_names = column_names.collect(&:to_sym)
column_names << :id if column_names.size.zero?
block =