Before you start
- Install the DuckDB command-line client using its official installation instructions. On macOS with Homebrew, run brew install duckdb.
- These SQL examples assume input.tsv has exactly the columns id and note. Adjust force_not_null and the editing expressions for your actual columns; add second.tsv for merging.
- Run duckdb in the folder containing the files, paste this SQL, then enter .quit when finished.
DuckDB SQL
DESCRIBE SELECT * FROM read_csv('input.tsv', delim='\t', header=true, all_varchar=true, force_not_null=['id','note']);
SELECT * FROM read_csv('input.tsv', delim='\t', header=true, all_varchar=true, force_not_null=['id','note']) LIMIT 10;
Limits and output
- all_varchar keeps columns as text; force_not_null keeps empty id and note fields as empty strings rather than SQL NULL. DuckDB may normalize blank or duplicate column names, so use Python's columns/rows JSON shape when exact headers matter.
- This reads spreadsheet-quoted TSV, not ClickHouse-style backslash-escaped TSV. SQL exports retain literal formula-looking strings; spreadsheet applications may interpret them when opened.
- File size and operation complexity still depend on available memory and disk space; no universal large-file guarantee applies.
Documentation: DuckDB installation; DuckDB CSV options; DuckDB COPY exports