-
Notifications
You must be signed in to change notification settings - Fork 204
[BugFix] Key date_time pushdown on field type, not literal UDT (#5481) #5515
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
RyanL1997
merged 6 commits into
opensearch-project:main
from
RyanL1997:worktree-timestamp-format-pushdown-5481
Jun 8, 2026
+271
−22
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9aa7976
[BugFix] Key date_time pushdown on field type, not literal UDT (#5481)
RyanL1997 1c8b5df
Add VARCHAR-literal regression test and trim helper comments
RyanL1997 1dfe1b7
Apply spotless formatting to PredicateAnalyzer test
RyanL1997 311d38f
Address review: reuse addFormatIfNecessary + value(), add e2e/yaml tests
RyanL1997 0d1e926
Trim issue-specific details from IT comment
RyanL1997 b8da41a
Move convertEndpointValue null check to method start
RyanL1997 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
69 changes: 69 additions & 0 deletions
69
integ-test/src/yamlRestTest/resources/rest-api-spec/test/issues/5481.yml
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,69 @@ | ||
| # Issue: https://github.com/opensearch-project/sql/issues/5481 | ||
| # A timestamp range comparison AND'd with an IN clause on another field must push down and | ||
| # return rows. Calcite folds the IN into a Sarg and strips the timestamp literal's UDT; without | ||
| # the field-type-keyed fix the range query ships an unformatted date and the shard rejects it. | ||
| setup: | ||
| - do: | ||
| query.settings: | ||
| body: | ||
| transient: | ||
| plugins.calcite.enabled: true | ||
|
|
||
| - do: | ||
| indices.create: | ||
| index: issue5481 | ||
| body: | ||
| settings: | ||
| number_of_shards: 1 | ||
| number_of_replicas: 0 | ||
| mappings: | ||
| properties: | ||
| event_time: | ||
| type: date | ||
| severity: | ||
| type: keyword | ||
|
|
||
| - do: | ||
| bulk: | ||
| refresh: true | ||
| body: | ||
| - '{"index": {"_index": "issue5481", "_id": "1"}}' | ||
| - '{"event_time": "2026-05-28T10:00:00Z", "severity": "ERROR"}' | ||
| - '{"index": {"_index": "issue5481", "_id": "2"}}' | ||
| - '{"event_time": "2026-05-28T10:05:00Z", "severity": "WARN"}' | ||
| - '{"index": {"_index": "issue5481", "_id": "3"}}' | ||
| - '{"event_time": "2026-05-28T10:10:00Z", "severity": "INFO"}' | ||
| - '{"index": {"_index": "issue5481", "_id": "4"}}' | ||
| - '{"event_time": "2026-05-28T10:15:00Z", "severity": "ERROR"}' | ||
| - '{"index": {"_index": "issue5481", "_id": "5"}}' | ||
| - '{"event_time": "2026-05-28T10:20:00Z", "severity": "WARN"}' | ||
| - '{"index": {"_index": "issue5481", "_id": "6"}}' | ||
| - '{"event_time": "2026-05-28T10:25:00Z", "severity": "DEBUG"}' | ||
|
|
||
| --- | ||
| teardown: | ||
| - do: | ||
| indices.delete: | ||
| index: issue5481 | ||
| ignore_unavailable: true | ||
| - do: | ||
| query.settings: | ||
| body: | ||
| transient: | ||
| plugins.calcite.enabled: false | ||
|
|
||
| --- | ||
| "Issue 5481: timestamp range AND keyword IN pushes down and returns rows": | ||
| - skip: | ||
| features: | ||
| - headers | ||
| - do: | ||
| headers: | ||
| Content-Type: 'application/json' | ||
| ppl: | ||
| body: | ||
| query: source=issue5481 | where event_time > timestamp('2026-05-28 10:08:00') | where severity in ('ERROR', 'WARN') | fields severity, event_time | sort event_time | ||
|
|
||
| - match: { total: 2 } | ||
| - match: { schema: [ { name: severity, type: "string" }, { name: event_time, type: "timestamp" } ] } | ||
| - match: { datarows: [ [ "ERROR", "2026-05-28 10:15:00" ], [ "WARN", "2026-05-28 10:20:00" ] ] } |
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
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.