v.23.6Improvement

Allow Skipping Trailing Empty Lines in CSV/TSV/CustomSeparated Formats via Settings

Allow to skip trailing empty lines in CSV/TSV/CustomSeparated formats via settings input_format_csv_skip_trailing_empty_lines, input_format_tsv_skip_trailing_empty_lines and input_format_custom_skip_trailing_empty_lines (disabled by default). Closes #49315. #50635 (Kruglov Pavel).
Allows skipping trailing empty lines in CSV, TSV, and CustomSeparated input formats by introducing new settings.

Why it matters

This feature addresses the issue where empty lines at the end of input files in CSV, TSV, or CustomSeparated formats could cause parsing errors or require manual cleanup. By enabling the skipping of trailing empty lines, it improves resilience and convenience during data import, reducing errors and simplifying processing of files with inconsistent line endings.

How to use it

To enable skipping trailing empty lines, set the following settings to true as needed: input_format_csv_skip_trailing_empty_lines, input_format_tsv_skip_trailing_empty_lines, and/or input_format_custom_skip_trailing_empty_lines. These settings are disabled by default and can be applied by specifying them in the query settings or server configuration.