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

Window function translation to SQL #176

Closed
jarodmeng opened this issue Aug 4, 2017 · 0 comments
Closed

Window function translation to SQL #176

jarodmeng opened this issue Aug 4, 2017 · 0 comments
Labels
dbplyr 🔧 feature a feature request or enhancement wip work in progress

Comments

@jarodmeng
Copy link
Contributor

Currently sd(), all() and any() window functions are translated to SQL using the following snippet.

    dbplyr::sql_translator(
      .parent = dbplyr::base_win,
      sd = dbplyr::win_recycled("sd"),
      all = dbplyr::win_recycled("all"),
      any = dbplyr::win_recycled("any"),
      ...
    )

This produces wrong SQL translation as sd() should be translated to STDDEV_SAMP(); all() to LOGICAL_AND() and any() to LOGICAL_OR().

Furthermore, BigQuery doesn't support OVER() clause for LOGICAL_AND() and LOGICAL_OR(). So all() and any() should be translated using win_absent() instead.

@hadley hadley added feature a feature request or enhancement wip work in progress dbplyr 🔧 labels Mar 28, 2018
@hadley hadley closed this as completed in c02c75d Apr 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dbplyr 🔧 feature a feature request or enhancement wip work in progress
Projects
None yet
Development

No branches or pull requests

2 participants