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

SQL: Fix the MINUTE_OF_DAY() function that throws exception when used in comparisons (#68783) #68854

Merged
merged 1 commit into from
Feb 10, 2021

Conversation

palesz
Copy link
Contributor

@palesz palesz commented Feb 10, 2021

The MINUTE_OF_DAY() extraction function does not have an equivalent
expressible using a datetime format pattern.

The MinuteOfDay.dateTimeFormat() is called during the query
translation and throws an exception, but the return value actually
does not impact the translated query (binary comparisons with
DateTimeFunction on one side always turn into a script query).

This change fixes the immediate issue raised as part of #67872,
add integration tests covering the problem, but leaves the removal
of the unnecessary dateTimeFormat() function a separate PR.

… in comparisons (elastic#68783)

The `MINUTE_OF_DAY()` extraction function does not have an equivalent
expressible using a datetime format pattern.

The `MinuteOfDay.dateTimeFormat()` is called during the query
translation and throws an exception, but the return value actually
does not impact the translated query (binary comparisons with
`DateTimeFunction` on one side always turn into a script query).

This change fixes the immediate issue raised as part of elastic#67872,
add integration tests covering the problem, but leaves the removal
of the unnecessary `dateTimeFormat()` function a separate PR.
@palesz palesz added :Analytics/SQL SQL querying >bug backport Team:QL (Deprecated) Meta label for query languages team v7.11.1 labels Feb 10, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-ql (Team:QL)

@palesz palesz merged commit 7aad648 into elastic:7.11 Feb 10, 2021
@palesz palesz deleted the minute_of_day-fix-7.11 branch February 10, 2021 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/SQL SQL querying backport >bug Team:QL (Deprecated) Meta label for query languages team v7.11.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants