-
Notifications
You must be signed in to change notification settings - Fork 25.5k
ESQL Fix bug when renaming @timestamp in TS queries #136062
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
base: main
Are you sure you want to change the base?
Conversation
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
Hi @not-napoleon, I've created a changelog YAML for you. |
} | ||
if (attr.name().equals(MetadataAttribute.TIMESTAMP_FIELD)) { | ||
timestamp.set(attr); | ||
} |
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 consider it a happy bonus of this PR that we are no longer fishing out the timestamp as part of the translate rule. I wonder if we should do something similar for the TSID. It just seems wrong to be doing this here.
* @param typeToken Only process expressions matching the given type | ||
* @param rule a non-modifying consumer which operates on the given token type | ||
* @param <E> the type of expression this pass will process | ||
*/ |
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 had to ask @fang-xing-esql how this worked, so I've written down what I learned from that conversation.
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 didn't add a randomized timestamp to the serialization tests because I expect that it won't be serialized.
Resolves #134994
This PR addresses the issue with queries like
Here, the
rate
aggregation function has an implied argument of@timestamp
, but that field no longer exists when we get to the to the stats command. To solve this, we introduce a new specialization to theResolveRefs
rule that finds the timestamp alias and plumbs it into theTimeSeriesAggregation
. In addition to fixing the references for the implied arguments, it also sends the reference on as part of theTimeSeriesAggregation
for other use in theTranslateTimeSeriesAggregate
rule.