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

Fix distinct() for SQL sources #1942

Merged
merged 6 commits into from
Jun 20, 2016
Merged

Conversation

krlmlr
Copy link
Member

@krlmlr krlmlr commented Jun 18, 2016

Without columns:

  • .keep_all is ignored if no columns are selected

With columns:

  • .keep_all = FALSE is implemented using a grouped select
  • .keep_all = TRUE still raises an error, because DISTINCT syntax seems to vary between SQL dialects

Adapted tests.

Fixes #1937.

@codecov-io
Copy link

codecov-io commented Jun 18, 2016

Current coverage is 61.68%

Merging #1942 into master will increase coverage by 0.04%

@@             master      #1942   diff @@
==========================================
  Files           188        188          
  Lines          7459       7468     +9   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           4598       4607     +9   
  Misses         2861       2861          
  Partials          0          0          

Powered by Codecov. Last updated by 284b91d...6afb0b0

@hadley
Copy link
Member

hadley commented Jun 20, 2016

Would you mind adding a test for the SQL generation too?

@krlmlr
Copy link
Member Author

krlmlr commented Jun 20, 2016

What do you have in mind -- something like the tests in test-sql-render.R?

@hadley
Copy link
Member

hadley commented Jun 20, 2016

Yeah exactly - when reviewing this PR it would help if I had a concrete example of the SQL that is generated.

@krlmlr
Copy link
Member Author

krlmlr commented Jun 20, 2016

Done. On second thought, SELECT DISTINCT y might be a simpler query for the second case; not sure how portable it is though.

@hadley hadley merged commit 563b562 into tidyverse:master Jun 20, 2016
@hadley
Copy link
Member

hadley commented Jun 20, 2016

Thanks - that seems like a reasonable approach to me.

@lock
Copy link

lock bot commented Jan 18, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants