Is there any way to insert a record even if the data received is less than expected number of columns?
I frequently get the following message.
Too few columns: expected 24 column(s) but got 22 column(s)
If I ignore such records using max_bad_record option, I loose the data. I will like to see an option that will forcefully insert a record by adding extra delimiters if required.
As Michael Sheldon mentions below, if you specify allowJaggedRows, a row that has too few columns will get NULL for all of the remaining columns. If you have missing columns in the middle of the row, however, BigQuery doesn’t know which column is missing, and if the types don’t match up, you’ll get an error for the row.
There has been some talk about adding all rows with errors into a separate table, so that you could then process them and append them to the original table. If you would find this useful let me know.