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

[ESQL] Mark date_diff as requiring all three arguments #108834

Merged

Conversation

not-napoleon
Copy link
Member

Resolves #108383

I didn't see a good place to add a test for this; if there is one, let me know and I'm happy to add it.

This fixes a bug where we had incorrectly marked date_diff as having an optional argument, which resulted in an NPE when that argument was not provided. In fact, all three of date_diff's arguments are required. After this change, failing to provide one will cause a parse exception, as one would expect.

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label May 20, 2024
@elasticsearchmachine
Copy link
Collaborator

Hi @not-napoleon, I've created a changelog YAML for you.

Copy link
Contributor

@bpintea bpintea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess a test could invoke date_diff with just 2 args and observe the parsing exception, but that's a bit superfluous, so it LGTM.

Copy link
Member

@costin costin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@costin
Copy link
Member

costin commented May 21, 2024

Since this is a bug, please backport it to 8.14.

@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.14

not-napoleon added a commit to not-napoleon/elasticsearch that referenced this pull request May 21, 2024
Resolves elastic#108383

I didn't see a good place to add a test for this; if there is one, let me know and I'm happy to add it.

This fixes a bug where we had incorrectly marked date_diff as having an optional argument, which resulted in an NPE when that argument was not provided. In fact, all three of date_diff's arguments are required. After this change, failing to provide one will cause a parse exception, as one would expect.
elasticsearchmachine pushed a commit that referenced this pull request May 21, 2024
…8874)

Resolves #108383

I didn't see a good place to add a test for this; if there is one, let me know and I'm happy to add it.

This fixes a bug where we had incorrectly marked date_diff as having an optional argument, which resulted in an NPE when that argument was not provided. In fact, all three of date_diff's arguments are required. After this change, failing to provide one will cause a parse exception, as one would expect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.14.0 v8.14.1 v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DATE_DIFF() with just two args fails with NPE
4 participants