Skip to content

Disallow null offset in lead/lag window functions#19015

Merged
martint merged 1 commit intotrinodb:masterfrom
martint:lead-lag-null-offset
Oct 24, 2023
Merged

Disallow null offset in lead/lag window functions#19015
martint merged 1 commit intotrinodb:masterfrom
martint:lead-lag-null-offset

Conversation

@martint
Copy link
Member

@martint martint commented Sep 12, 2023

Per the SQL spec, the offset cannot be null.

<lead or lag function> ::=
  <lead or lag> <left paren> <lead or lag extent>
      [ <comma> <offset> [ <comma> <default expression> ] ] <right paren>
      [ <window function null treatment> ]

<offset> ::=
  <unsigned integer>

Moreover, it should be a constant value, but this is not being addressed in this change.

Fixes #19003

Release notes

(x) Release notes are required, with the following suggested text:

# General
* Disallow a null offset in {func}`lead` and {func}`lag`. ({issue}`19003`)

@cla-bot cla-bot bot added the cla-signed label Sep 12, 2023
@github-actions github-actions bot added the docs label Sep 12, 2023
@martint martint force-pushed the lead-lag-null-offset branch from dc336a8 to 383ab1f Compare September 12, 2023 21:48
Per the SQL spec, the offset cannot be null.

    <lead or lag function> ::=
      <lead or lag> <left paren> <lead or lag extent>
          [ <comma> <offset> [ <comma> <default expression> ] ] <right paren>
          [ <window function null treatment> ]

    <offset> ::=
      <unsigned integer>

Moreover, it should be a constant value, but this is not being addressed in this change.
@martint martint force-pushed the lead-lag-null-offset branch from 383ab1f to 8614ade Compare September 13, 2023 02:43
@martint martint merged commit b4760da into trinodb:master Oct 24, 2023
@github-actions github-actions bot added this to the 431 milestone Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Lead/Lag function does not return default value for out of range offset

2 participants