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

df_from_parquet() doesn't take a directory name? #181

Closed
hadley opened this issue Jul 5, 2024 · 5 comments · Fixed by #186
Closed

df_from_parquet() doesn't take a directory name? #181

hadley opened this issue Jul 5, 2024 · 5 comments · Fixed by #186

Comments

@hadley
Copy link
Member

hadley commented Jul 5, 2024

> logs <- duckplyr::df_from_parquet("logs/")
Error:
! {"exception_type":"IO","exception_message":"No files found that match the pattern \"logs/\""}
Show Traceback

But this is ok:

logs <- duckplyr::df_from_parquet(dir("logs/", full.names = TRUE))
@hadley
Copy link
Member Author

hadley commented Jul 5, 2024

Oh but that second one only reads a single data frame.

What actually works is duckplyr_df_from_parquet("logs/*.parquet")

@hadley
Copy link
Member Author

hadley commented Jul 5, 2024

But even when I get it working it's basically unusable. I'll try find some time to show @krlmlr in person next week.

@krlmlr
Copy link
Member

krlmlr commented Jul 6, 2024

Does bind_rows() give you a better experience? See #146 (comment) :

file_paths %>% map(duckplyr_df_from_parquet) %>% bind_rows()

@krlmlr
Copy link
Member

krlmlr commented Jul 8, 2024

bind_rows() reads into memory, %>% reduce(union_all) is better but will also read into memory in duckplyr 0.4.0 (works better in duckplyr 0.3.0): tidyverse/dplyr#7049 .

What should work is duckplyr_df_from_csv("file_*.csv"), but I'm seeing mixed results too: duckdb/duckdb#12903 .

Action items:

@krlmlr
Copy link
Member

krlmlr commented Jul 10, 2024

bind_rows() is not a generic, unfortunately. Will solve with documentation.

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 a pull request may close this issue.

2 participants