Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add col.types to duckdb_read_csv #445

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

eli-daniels
Copy link

@eli-daniels eli-daniels commented Sep 30, 2024

This addresses 2 issues: #118 and #383

col.types can be given as a named character vector providing the names and types of the columns such as: col.types = c(col0 = 'VARCHAR', col1 = 'COUBLE' , etc..) or an unnamed character vector, then col names are taken from the read.csv output or the col.names argument. Column names given by col.types are preferred over col.names.

The data types are provided as DuckDB data types, so VARCHAR, DOUBLE, BIGINT, etc...

As part of this I changed dbWriteTable to dbCreateTable. So could easily add the temporary parameter mentioned here #142, but don't want to get ahead of myself.

Also made a minor addition to the docs to mention that the csv files are appended to the table if the table already exists, I hope that is okay.

Happy to modify anything that may be amiss!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant