-
Notifications
You must be signed in to change notification settings - Fork 25.6k
ESQL: Fix functions emitting warnings with no source #122821
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
ESQL: Fix functions emitting warnings with no source #122821
Conversation
…sabling serialization on broken functions
…in the future if we need it
…ons-warnings-fix # Conflicts: # server/src/main/java/org/elasticsearch/TransportVersions.java
# Conflicts: # server/src/main/java/org/elasticsearch/TransportVersions.java
|
Hi @ivancea, I've created a changelog YAML for you. |
| @Override | ||
| public TestCase get() { | ||
| TestCase supplied = supplier.get(); | ||
| if (types.size() != supplied.getData().size()) { |
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.
The for below wasn't checking the case where the TestCase data had more types than the supplier. This required fixing some cases in Top and Case
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.
This was one of the affected functions by the "warnings but no source" problem, but it had no tests for them. So here I added them based on the function errors
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
| /** | ||
| * Returns a list with N dataType1, followed by 1 dataType2. | ||
| */ | ||
| private static List<DataType> makeTypes(DataType dataType1, DataType dataType2, int n) { |
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.
Optional:
| private static List<DataType> makeTypes(DataType dataType1, DataType dataType2, int n) { | |
| private static List<DataType> typesList(DataType dataType1, DataType dataType2, int n) { |
astefan
left a comment
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.
I was expecting to see some changes in IT tests as well, meaning warning message that started having proper line:column numbers.
Do you know why the change in this PR is not "visible" in IT tests?
# Conflicts: # server/src/main/java/org/elasticsearch/TransportVersions.java
|
@astefan From what I saw, there are no CSV tests with warnings for those functions. I'll add some cases + capability for them to double-check. |
|
I don't know exactly what we have and what don't for this particular set of functionality this PR is addressing, thus my evasiveness. I am ok with CSV IT tests. Since this involves serializations and, implicitly, type resolution on the data nodes, make sure the queries used trigger this fix properly. |
astefan
left a comment
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
# Conflicts: # server/src/main/java/org/elasticsearch/TransportVersions.java
Fixes #122588
Source.EMPTY.writeTo(out)tosource().writeTo(out)in functions emitting warningsPostAnalysisVerificationAwareTransportVersionto do soToLowerandToUpperweren't serializing a source, but they don't emit warnings. As they were the only remaining functions not serializing the source, I added it there too