Created
May 29, 2023 18:51
-
-
Save fangzhou-xie/99bccdae0171cd6af796242e63e5ee98 to your computer and use it in GitHub Desktop.
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
# duckdb import tsv snippet | |
duckdb_fp | |
tsv_fp | |
con <- DBI::dbConnect(duckdb::duckdb(), duckdb_fp) | |
# config duckdb | |
DBI::dbExecute(con, "SET memory_limit='20GB';") | |
DBI::dbExecute(con, "SET threads TO 20;") | |
DBI::dbExecute( | |
con, | |
glue::glue("CREATE TABLE bup AS SELECT * FROM read_csv_auto('{tsv_fp}', delim='\t', nullstr=\"NA\");") | |
) | |
DBI::dbDisconnect(con, shutdown=TRUE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment