Open RicoGit opened 3 years ago
The current implementation assumes that all rows have the same number and types of columns (but for optional fields, it is possible to implement adding columns when they are not in the first row). This check is needed because the first row creates all the columns in the block.
This check is needed because the first row creates all the columns in the block.
Why? What would be broken if we allow creating columns for any row in the block?
Why <= 1
, not a == 0
?
I've tried to insert a batch of rows into Db and reached OutOfRange error. Looks like a problem in the case when the first row contains fewer columns than the next ones. I found this piece of code, why do we need to check this:
if block.row_count() <= 1
?For example, I have a table with 2 optional fields with default values (a and b). I'm tried to insert next batch:
This input data can't be inserted, because after adding row number 2 into a block, the block will have size 1 and it'll fail the check:
if block.row_count() <= 1
.