ESQL: Forbid SET nullify and load for implicit @timestamp field#144239
Merged
astefan merged 11 commits intoelastic:mainfrom Mar 19, 2026
Merged
ESQL: Forbid SET nullify and load for implicit @timestamp field#144239astefan merged 11 commits intoelastic:mainfrom
astefan merged 11 commits intoelastic:mainfrom
Conversation
6cfd6c1 to
fdfb130
Compare
Collaborator
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
…142127_implementation
GalLalouche
requested changes
Mar 18, 2026
| assert partialMetrics != null; | ||
| Failures failures = new Failures(); | ||
|
|
||
| boolean unmappedTimestampHandled = false; |
Contributor
There was a problem hiding this comment.
Consider:
unmappedTimestampHandled = unmappedResolution == UnmappedResolution.FAIL || checkUnmappedTimestamp(plan, failures)| * if the field was present but dropped/renamed by the query, the generic unresolved-attribute message is more appropriate. | ||
| * See https://github.com/elastic/elasticsearch/issues/142127 | ||
| */ | ||
| private static boolean checkUnmappedTimestamp(LogicalPlan plan, Failures failures) { |
Contributor
There was a problem hiding this comment.
I think this method should be renamed so it's clear what it's actually returning, e.g., isTimestampUnmappedInAllIndices or something to that effect.
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/analysis/Verifier.java
Show resolved
Hide resolved
| ); | ||
| } | ||
|
|
||
| private void unmappedTimestampFailure(String query, String... expectedFailures) { |
Contributor
There was a problem hiding this comment.
It looks like you're always appending the suffix to the expectedFailures. Why not just do it in this method instead of in all the other places?
|
|
||
| public void testTbucketWithTimestampPresent() { | ||
| for (var statement : List.of( | ||
| setUnmappedNullify("FROM sample_data | STATS c = COUNT(*) BY tbucket(1 hour)"), |
| } | ||
|
|
||
| public void testTrangeWithTimestampPresent() { | ||
| for (var statement : List.of( |
...k/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/AnalyzerUnmappedTests.java
Show resolved
Hide resolved
…142127_implementation
GalLalouche
approved these changes
Mar 18, 2026
dnhatn
approved these changes
Mar 18, 2026
Contributor
Author
|
Thank you @GalLalouche @dnhatn for the reviews 👍 |
michalborek
pushed a commit
to michalborek/elasticsearch
that referenced
this pull request
Mar 23, 2026
This was referenced Mar 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #142127