-
Notifications
You must be signed in to change notification settings - Fork 26.1k
Add TimestampBoundsAware analysis mechanism #142750
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
0c58bf7
Add TimestampBoundsAware analysis mechanism
felixbarny ca192e3
Merge remote-tracking branch 'origin/main' into timestamp-bounds-aware
felixbarny 8f4eb61
Fix post merge compile error
felixbarny 6c3ddd9
[CI] Auto commit changes from spotless
2fb27a8
Fix compile error
felixbarny 6d04e78
Add test to ignore `should` matchers
felixbarny 0213b87
Merge remote-tracking branch 'origin/main' into timestamp-bounds-aware
felixbarny 41b6c3d
Avoid unchecked casts by creating sub-interfaces for expressions and …
felixbarny 13f44a9
Merge remote-tracking branch 'origin/main' into timestamp-bounds-aware
felixbarny 2077837
Make implementations of TimestampBoundsAware responsible for the vali…
felixbarny ebb5b1f
[CI] Auto commit changes from spotless
723a7f8
Merge remote-tracking branch 'origin/main' into timestamp-bounds-aware
felixbarny 42e92aa
Merge branch 'main' into timestamp-bounds-aware
felixbarny ccddd33
Merge branch 'main' into timestamp-bounds-aware
felixbarny 8ad8b93
Merge remote-tracking branch 'origin/main' into timestamp-bounds-aware
felixbarny f2c5424
[CI] Auto commit changes from spotless
9c57e2e
Merge branch 'main' into timestamp-bounds-aware
felixbarny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
41 changes: 41 additions & 0 deletions
41
.../src/main/java/org/elasticsearch/xpack/esql/expression/function/TimestampBoundsAware.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| package org.elasticsearch.xpack.esql.expression.function; | ||
|
|
||
| import org.elasticsearch.xpack.esql.analysis.Analyzer; | ||
| import org.elasticsearch.xpack.esql.analysis.Verifier; | ||
| import org.elasticsearch.xpack.esql.capabilities.ConfigurationAware; | ||
| import org.elasticsearch.xpack.esql.capabilities.PostAnalysisVerificationAware; | ||
| import org.elasticsearch.xpack.esql.core.expression.Literal; | ||
|
|
||
| /** | ||
| * Marker interface for nodes (expressions or plans) that require {@code @timestamp} bounds derived from the query DSL filter. | ||
| * <p> | ||
| * Implementations are resolved during analysis by {@link Analyzer}'s {@code ResolveTimestampBoundsAware} rule, | ||
| * following the same pattern as {@link ConfigurationAware}. | ||
| * </p> | ||
| * <p> | ||
|
felixbarny marked this conversation as resolved.
|
||
| * Expression implementations that still {@link #needsTimestampBounds() need bounds} after analysis are automatically | ||
| * rejected by the {@link Verifier} with a client error. | ||
| * LogicalPlan implementations are responsible for their own validation via {@link PostAnalysisVerificationAware#postAnalysisVerification}. | ||
| * </p> | ||
| * | ||
| * @param <T> the type returned by {@link #withTimestampBounds}, typically {@code Expression} or {@code LogicalPlan} | ||
| */ | ||
| public interface TimestampBoundsAware<T> { | ||
|
|
||
| /** | ||
| * Returns {@code true} if this node still needs timestamp bounds to be injected. | ||
| */ | ||
| boolean needsTimestampBounds(); | ||
|
|
||
| /** | ||
| * Returns a copy of this node with the given timestamp bounds applied. | ||
| */ | ||
| T withTimestampBounds(Literal start, Literal end); | ||
| } | ||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.