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: Bug fix for the optional "start" parameter usage inside LOCATE function #32576

Merged
merged 3 commits into from
Aug 9, 2018

Conversation

astefan
Copy link
Contributor

@astefan astefan commented Aug 2, 2018

The incorrect NodeInfo is created when the optional parameter is not used, leading to the incorrect constructor being used.

Fixes #32554

…used, leading to the incorrect constructor being used.

Fixes elastic#32554
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@@ -85,6 +85,10 @@ public final void collectFields(SqlSourceBuilder sourceBuilder) {

@Override
protected NodeInfo<LocateFunctionProcessorDefinition> info() {
if (start == null) {
return NodeInfo.create(this, LocateFunctionProcessorDefinition::new, expression(), pattern, source);
Copy link
Member

Choose a reason for hiding this comment

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

Hmmmm. I think it might be less error prone if only have the one constructor for LocateFunctionProcessorDefinition. Is that possible?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nik9000 I know I already tried this as a first option when I started implementing these, but I don't remember why it didn't work out. I think it was about the same reason: null children in the constructor. I'll revisit, maybe I'll find another way.

Copy link
Member

Choose a reason for hiding this comment

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

If that funny test gets in your way then ping me! I think I can help work around it.....

@astefan
Copy link
Contributor Author

astefan commented Aug 2, 2018

@nik9000 I've simplified this by using one constructor. Tests passed so far. Let me know your thoughts.

@astefan astefan requested a review from imotov August 3, 2018 17:25
Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

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

LGTM

@astefan astefan merged commit 7b618f3 into elastic:master Aug 9, 2018
astefan added a commit that referenced this pull request Aug 9, 2018
…unction (#32576)

The incorrect NodeInfo is created when the optional parameter is not used, leading to the incorrect constructor being used. Simplified LocateFunctionProcessorDefinition by using one constructor instead of two.
Fixes #32554
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants