I tried to run this command:
drush sf-import 3124860e3cb9faa393e014471460eced --count=10000
and I got this message:
drush: Start/count exceed possible rows. Number of rows in Salesfoce : 1000
Drush command terminated abnormally due to an unrecoverable error. [error]
The thing is, there are over 100K records matching this map.
Basically, the SELECT performed around line 247 in sf_import.drush.inc in my case returns the first 1000 records (which is my limit of returns per API call). Since I am calling for 10,000 records, it thinks I'm asking for too many records. The code is not taking into account the fact that it needs to loop and get more records if there are any more to retrieve.
Comments
Comment #1
dpearcefl commentedThis patch addresses the following issues:
Comment #2
joeybaker commentedThank you!
But, I get a
warning: Invalid argument supplied for foreach() in sites/all/modules/salesforce/sf_import/sf_import.module on line 130.Comment #3
dpearcefl commentedjoeybaker, are you using Drush? That line number corresponds to the function sf_import_settings_form().
This patch only applies to drush and the command sf-import.
Comment #4
dpearcefl commentedFixes a bug in the above patch having to do with the $count and $start variables. Refined the messages a little more.
Comment #5
dpearcefl commentedOK, I found some other counting issues. Hold on...
Comment #6
dpearcefl commentedOK, here's the best patch. Catches all manner of weird command line options.
Comment #7
EvanDonovan commentedTracking also for 7.x-2.x.
Comment #8
dpearcefl commentedSigh. I'm going to have to rework some of the looping. With my 108K+ Opportunities records, an sf-import can take over 500MB. Not useful.
Comment #9
Alice Heaton commentedHi,
Do you mean 500MB of RAM ? A bit heavy indeed :)
It is unfortunate SOQL does not provide a proper LIMIT statement.
What do you think about :
so that it takes into account the 'start' and 'count' parameters.
As it goes drop entries earlier than 'start', and stop querying once it reached 'start' + 'count'.
Hopefully this should free up the memory we don't actuall use ;
and 'count' accordingly. The advantage of doing this externally is that it can be spread out,
for instance doing one chunk every cron run.
I don't have such a large data set, so it's a bit hard for me to test whether this would actually help.
Comment #10
kostajh commented