Using migrate-7.x-2.6-RC1.

Motivation

Have you ever had a problem that certain rows in the CSV files used for Migration were empty, or didn't
need to be imported because of bogus data / empty fields?

Or maybe your CSV data is de-normalised and you want to skip certain rows that would
map to the same entities, but because of the skipping, your migration always shows
Incomplete Migration? Isn't that annoying? Especially if there are other dependent migrations
on the incomplete one, which won't run unless executed with --force.

Solution

The Migrate CSV to SQL module provides a way to import CSV data into intermediary SQL tables,
after which you can use a MigrateSQLSource with standard db_select queries to preprocess/select only the data you need,
thus eliminating problems with non-conforming CSV rows, empty CSV rows, bogus CSV rows, etc.

An example module is provided (with code comments), to show how to import the CSV files into the DB,
after which the DB tables can be used as a data source.