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

Is it possible to get table name to be used in dbplyr::sql #67

Open
era127 opened this issue Oct 21, 2023 · 1 comment
Open

Is it possible to get table name to be used in dbplyr::sql #67

era127 opened this issue Oct 21, 2023 · 1 comment

Comments

@era127
Copy link

era127 commented Oct 21, 2023

I am trying to add an operation to the end of my pipeline that uses the duckdb PIVOT expression.

To use dbplyr::sql() with a manual sql query I would need to get the name of the table that is used in the query which is created by as_duckplyr_df(). Is that possible?

Alternatively, is it possible to map the duckdb PIVOT expression to dplyr verbs?

@krlmlr
Copy link
Collaborator

krlmlr commented Oct 22, 2023

Thanks, interesting use case. None of this seems to be available out of the box, but making a data frame available in duckdb via duckdb::duckdb_register() is instantaneous, perhaps with a small performance overhead during runtime.

The first option would be the equivalent of compute(), with a way to feed the result into an SQL expression. Let me think about an API here.

Ideally, we would support pivot_wider() and pivot_longer() natively, this seems to be much further down the road.

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

No branches or pull requests

2 participants