Repository navigation
Fix empty CSV/TSV fields storing 0 in an Enum without a 0 element - #130975
PedroTadim merged 2 commits into
Conversation
|
Workflow [PR], commit [307520b] Summary: ✅
AI ReviewSummaryThe PR uses type-aware defaults for empty, invalid, and omitted Final VerdictStatus: ✅ Approve |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Slowest function optimization changes (ThinLTO)Median per-function time ratio to the master baseline:
Compile time of recompiled translation units162 translation units recompiled, 1328 s compile time in total, 162 of them have a recent master baseline. |
|
@lazerg @PedroTadim — ClickGap found the following in this PR:
Close anything that's wrong or already addressed. |
Closes: #130598
When CSV or TSV reads an empty field as the default value, it called
column.insertDefault(), which writes a raw 0 into the column. For anEnumwithout a 0 element that value is out of domain: theINSERTworks, but reading the column later throwsUNKNOWN_ELEMENT_OF_ENUM. The same happened for a bad value withinput_format_csv_use_default_on_bad_valuesand for fields cut off withallow_variable_number_of_columns. These places now calltype->insertDefaultInto(column), so anEnumgets its first element, asJSONEachRow,TSKVandValuesalready do.05621_csv_tsv_empty_field_enum_defaultcovers the four paths and anINSERT ... FORMAT CSVinto aMergeTreetable. Without the fix it fails withUNKNOWN_ELEMENT_OF_ENUM.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed an empty or missing
CSV/TSVfield being stored as 0 in anEnumcolumn that has no 0 element, which made later reads fail withUNKNOWN_ELEMENT_OF_ENUM. Now the field gets the firstEnumelement.Workflow [PR]
Sync PR [sync-upstream/pr/130975]
Version info
26.11.1.2197-master(included in26.11and later)