Repository navigation
Treat empty cells in CSV as default values. - #5625
Conversation
| /// 2. The value is overwritten by | ||
| /// AddingDefaultsBlockInputStream, so we don't care what it | ||
| /// is. Should we use IColumn::insertDefault() instead? | ||
| data_types[i]->insertDefaultInto(*columns[i]); |
There was a problem hiding this comment.
Does anybody know the answer to the above questions?
There was a problem hiding this comment.
If I remebmer correctly:
We need to return block with columns of corresponding size. Non-existing values should be prefilled nevertheless. Then we fill default values through applying if function or in similar way (that expect block with proper column sizes).
There was a problem hiding this comment.
(you can update your comment to mine)
|
|
||
| - Inserting data in [JSONEachRow](../../interfaces/formats.md#jsoneachrow) format. | ||
|
|
||
| For all other operations, ClickHouse doesn't apply the setting. |
There was a problem hiding this comment.
I deleted this big explanation about the extended data exchange and slightly extended the note about performance below. This option replaces empty cells with defaults, and the detailed description of how it's implemented doesn't make any difference to the user.
| skipWhitespacesAndTabs(istr); | ||
| const auto & type = data_types[*column_index]; | ||
| if (*istr.position() == delimiter | ||
| && format_settings.csv.empty_as_default) |
There was a problem hiding this comment.
Do we check for empty values at the last column?
INSERT INTO table (a, b) FORMAT CSV
Hello,
There was a problem hiding this comment.
(it requires comparison with \r and \n; we assume that unquoted newlines are not possible in value)
fe4e880 to
81ead1c
Compare
#5349
For changelog. Remove if this is non-significant change.
Category (leave one):