sergeant icon indicating copy to clipboard operation
sergeant copied to clipboard

Fix SQL translation for `lag()` and `lead()`

Open alistaire47 opened this issue 3 years ago • 0 comments

Hi!

Just a quick PR so Drill doesn't error out when using lead() or lag() with dbplyr SQL translation. Before this, the value for default (NA by default) would get passed in as a third argument (e.g. LAG(variable1, 1, NA)) which causes Drill to throw an error that refers users to this Jira ticket.

This implementation does pass through the value for n, which is 1L by default. Drill doesn't currently support any other value besides 1, but this implementation works and will be forwards-compatible if the limitation gets lifted in the future.

alistaire47 avatar May 20 '21 04:05 alistaire47