-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[ES|QL] Correct line and column numbers of missing named parameters #120852
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
Changes from 8 commits
5094523
e46c56e
2fe2dca
a044ed3
bfac49c
008e115
c71d146
525e6b4
19b44bc
48678f3
e224454
57467d5
02cdc87
01eabdd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| pr: 120852 | ||
| summary: Correct line and column numbers of missing named parameters | ||
| area: ES|QL | ||
| type: bug | ||
| issues: [] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: the changes here essentially just implement squashing multiple
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It makes sense, I was thinking about the same thing, I'll move these into |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -110,15 +110,23 @@ protected LogicalPlan plan(ParseTree ctx) { | |
| } else { | ||
| StringBuilder message = new StringBuilder(); | ||
| int i = 0; | ||
| int line = -1; | ||
| int charPositionInLine = -1; | ||
|
|
||
| while (errors.hasNext()) { | ||
| ParsingException e = errors.next(); | ||
| if (i > 0) { | ||
| message.append("; "); | ||
| message.append(e.getMessage()); | ||
| } else { | ||
| // line and column numbers are the associated with the first error | ||
| line = e.getLineNumber(); | ||
| charPositionInLine = e.getColumnNumber(); | ||
| message.append(e.getErrorMessage()); | ||
| } | ||
| message.append(errors.next().getMessage()); | ||
| i++; | ||
| } | ||
| throw new ParsingException(message.toString()); | ||
| throw new ParsingException(line, charPositionInLine, message.toString()); | ||
|
||
| } | ||
| } | ||
|
|
||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. optional: While we're at it, could we maybe add a short warning javadoc to the constructor that we no longer use for this, the one that doesn't take a source or line/char numbers? I think it'd help to point out that the error message will start with
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, will add a comment there. |
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.
Broken changelog reference :/