ForceCLI/force

Large CSV files with newlines are incorrectly splitted for upsert operations

Closed this issue · 3 comments

fuure commented

force version: v0.22.66

The split of large csv files for data loading operations is generating the batches splitting the source CSV file by rows instead of records, because if a file has newline characters in it (i.e. Long or rich text fields), the record uses more than one line in the file.

Batches then are incorrectly generated as they obviously don't meet the expected structure.

You can recreate this simply by creating a large csv file with newlines and insert/upsert/update-ing it on an instance.

We should use encoding/csv to read in the csv. splitFileIntoBatches is simply splitting on newlines.

I've opened #452 to fix parsing of multi-line values in csv.

Fixed in v0.22.81