Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Fix cast statement in aggregate function return 0 #773

Merged

Conversation

dai-chen
Copy link
Member

@dai-chen dai-chen commented Oct 8, 2020

Issue #, if available: #772

Description of changes: As per investigation in the issue, the root cause is return statement is missing in the painless script generated. Please the comment on the code changes for more details.

TO-DO: Other built-in functions also have this issue if we disable semantic analyzer (which disallow this) and do "SUM(ABS(a))". I tried a quick fix but it broke existing ITs. Here we only fix aggregate function on CAST statement. The issue should go away once new query engine enabled.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dai-chen dai-chen added bug Something isn't working SQL labels Oct 8, 2020
@dai-chen dai-chen self-assigned this Oct 8, 2020
@dai-chen dai-chen changed the base branch from master to develop October 8, 2020 22:39
@dai-chen dai-chen marked this pull request as ready for review October 8, 2020 23:02
@dai-chen dai-chen requested review from penghuo and chloe-zh October 8, 2020 23:02
Copy link
Contributor

@penghuo penghuo left a comment

Choose a reason for hiding this comment

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

Thanks for the fix.

@dai-chen dai-chen merged commit 5b9ff1a into opendistro-for-elasticsearch:develop Oct 13, 2020
@dai-chen dai-chen deleted the fix-sum-cast-issue branch October 13, 2020 17:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working SQL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants