Kyligence / ClickHouse

ClickHouse® is a free analytics DBMS for big data
https://clickhouse.com
Apache License 2.0
14 stars 17 forks source link

Fix input empty as default for nullable string field in CSV InputFormat #478

Closed KevinyhZou closed 7 months ago

KevinyhZou commented 7 months ago

Changelog category (leave one):

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Fix problems as described in https://github.com/ClickHouse/ClickHouse/pull/58225

While deserialize csv input, if we set the config input_format_csv_empty_as_default = true, which would set default value to field if the input is empty, and this is also take effect for Nullable(String) type, in this case, if the input is a empty string, then the field will be set default value as NULL, as show below image

Here it is not suitable,to set NULL when the input is empty for Nullable(String) type, and it is better to set a empty string for the field.

Documentation entry for user-facing changes

Information about CI checks: https://clickhouse.com/docs/en/development/continuous-integration/