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

DatabaseConnector dbplyr failing on duckdb when joining more than 2 tables #271

Open
schuemie opened this issue Apr 11, 2024 · 1 comment
Labels

Comments

@schuemie
Copy link
Member

With some recent release of a dependency (unsure which), the dbplyr interface no longer works for duckdb when joining more than 2 tables in a single statement. The reason for the failure is that dbplyr (its SQL Server backend) generates table aliases that are just numbers, which duckdb does not accept. For example, the SQL might look like this:

SELECT
  person.*,
  2.observation_period_start_date AS observation_period_start_date,
  2.observation_period_end_date AS observation_period_end_date,
  2.period_type_concept_id AS period_type_concept_id,
  3.observation_period_start_date AS dummy
FROM main.person
LEFT JOIN main.observation_period 2
  ON (person.person_id = 2.person_id)
LEFT JOIN main.observation_period 3
  ON (person.person_id = 3.person_id);

I think this might be a good occasion to think about switching out the backend for the native duckdb one, as @ablack3 is working on here. Adam, any chance you can finish this in the near future?

@schuemie schuemie added the bug label Oct 11, 2024
@schuemie
Copy link
Member Author

This should become moot when we switch to the new backends

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

No branches or pull requests

1 participant