Created
March 21, 2023 16:23
-
-
Save mehd-io/7978fb606845f07a2142fb0644e9d818 to your computer and use it in GitHub Desktop.
Convert CSV to Parquet using DuckDB CLI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# You can put this in your .bashrc or .zshrc | |
function csv_to_parquet() { | |
file_path="$1" | |
duckdb -c "COPY (SELECT * FROM read_csv_auto('$file_path')) TO '${file_path%.*}.parquet' (FORMAT PARQUET);" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment