ESQL: Add timezone to add and sub operators, and ConfigurationAware planning support#140101
Merged
ivancea merged 16 commits intoelastic:mainfrom Jan 9, 2026
Merged
ESQL: Add timezone to add and sub operators, and ConfigurationAware planning support#140101ivancea merged 16 commits intoelastic:mainfrom
ivancea merged 16 commits intoelastic:mainfrom
Conversation
… and added zoneId to evaluator builder
Collaborator
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
Collaborator
|
Hi @ivancea, I've created a changelog YAML for you. |
ivancea
commented
Dec 31, 2025
|
|
||
| private static Function<Object, Object> toDateTime(Converter conversion) { | ||
| return l -> DateUtils.asDateTime(((Number) conversion.convert(l)).longValue()); | ||
| return l -> DateUtils.asDateTime(((Number) conversion.convert(l)).longValue(), ZoneOffset.UTC); |
Contributor
Author
There was a problem hiding this comment.
This is just moving the UTC from inside to the caller.
Converters are being migrated in another PR, which may reuse the ConfigurationAware implementation when merged
# Conflicts: # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/optimizer/rules/logical/promql/TranslatePromqlToTimeSeriesAggregate.java
luigidellaquila
approved these changes
Jan 8, 2026
Contributor
luigidellaquila
left a comment
There was a problem hiding this comment.
LGTM, thanks @ivancea!
|
|
||
| private static Expression resolveConfigurationAware(Expression expression, Configuration configuration) { | ||
| if (expression instanceof ConfigurationAware ca && ca.configuration() == ConfigurationAware.CONFIGURATION_MARKER) { | ||
| return ca.withConfiguration(configuration); |
Contributor
There was a problem hiding this comment.
I like this solution, it's simple enough and effective 👍
| // quick verification for unresolved attributes | ||
| checkUnresolvedAttributes(plan, failures); | ||
|
|
||
| ConfigurationAware.verifyNoMarkerConfiguration(plan, failures); |
Contributor
Are we tracking all the changes we need to perform before we can un-snapshot |
szybia
added a commit
to szybia/elasticsearch
that referenced
this pull request
Jan 9, 2026
* upstream/main: (76 commits) [Inference API] Get _services skips EIS authorization call if CCM is not configured (elastic#139964) Improve TSDB codec benchmarks with full encoder and compression metrics (elastic#140299) ESQL: Consolidate test `BlockLoaderContext`s (elastic#140403) ESQL: Improve Lookup Join performance with CachedDirectoryReader (elastic#139314) ES|QL: Add more examples for the match operator (elastic#139815) ESQL: Add timezone to add and sub operators, and ConfigurationAware planning support (elastic#140101) ESQL: Updated ToIp tests and generated documentation for map parameters (elastic#139994) Disable _delete_by_query and _update_by_query for CCS/stateful (elastic#140301) Remove unused method ElasticInferenceService.translateToChunkedResults (elastic#140442) logging hot threads on large queue of the management threadpool (elastic#140251) Search functions docs cleanup (elastic#140435) Unmute 350_point_in_time/point-in-time with index filter (elastic#140443) Remove unused methods (elastic#140222) Add CPS and `project_routing` support for `_mvt` (elastic#140053) Streamline `ShardDeleteResults` collection (elastic#140363) Fix Docker build to use --load for single-platform images (elastic#140402) Parametrize + test VectorScorerOSQBenchmark (elastic#140354) `RecyclerBytesStreamOutput` using absolute offsets (elastic#140303) Define bulk float native methods for vector scoring (elastic#139885) Make `TimeSeriesAggregate` `TimestampAware` (elastic#140270) ...
jimczi
pushed a commit
to jimczi/elasticsearch
that referenced
this pull request
Jan 12, 2026
…lanning support (elastic#140101) Add timezone support to `Add` (+) and `Sub` (-) operators (Snapshot-only, as setting a timezone is snapshot-only too). Because those nodes are created in the parser, before the configuration is available, this PR also uses the `ConfigurationAware` interface, and completes its implementation by adding an `Analyzer` rule that replaces the "marker" configuration with the real one. Also, some validations were added in the `Verifiers` to ensure we don't end up with the marker configuration in any productive place. The list of changes: - ConfigurationAware handling in Analyzer and Verifiers - Added the Configuration to Add and Sub (+ their base class, + tests) - This required adding the configuration to many usages of Add and Sub in unrelated tests
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.
Add timezone support to
Add(+) andSub(-) operators (Snapshot-only, as setting a timezone is snapshot-only too).Because those nodes are created in the parser, before the configuration is available, this PR also uses the
ConfigurationAwareinterface, and completes its implementation by adding anAnalyzerrule that replaces the "marker" configuration with the real one.Also, some validations were added in the
Verifiersto ensure we don't end up with the marker configuration in any productive place.The list of changes: