-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Conversation
…used, leading to the incorrect constructor being used. Fixes elastic#32554
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.....
@nik9000 I've simplified this by using one constructor. Tests passed so far. Let me know your thoughts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The incorrect
NodeInfo
is created when the optional parameter is not used, leading to the incorrect constructor being used.Fixes #32554