fix(integ): align DateTimeComparisonIT today's date to UTC#5543
Merged
ahkcs merged 1 commit intoJun 11, 2026
Conversation
The TIME/DATE/TIMESTAMP comparison test parameters compute `today` via `LocalDate.now().toString()` (JVM-local zone), but the analytics-engine route lowers `CURRENT_DATE` through DataFusion using UTC. When a run starts after 17:00 PDT (= 00:00 UTC of the next day), the JVM date and the engine date disagree by one day, so TIME-to-TIMESTAMP coercion produces tomorrow's timestamp and 24 parameterized cases fail with expected=true got=false (and the inverse). Switch to `LocalDate.now(ZoneOffset.UTC)` so the test parameters use the same date the engine uses, regardless of when or where the run starts. Before/after (CalciteDateTimeComparisonIT, analytics-engine route, running at 18:43 PDT 2026-06-10): before: tests=191 failures=24 errors=0 after: tests=191 failures=0 errors=0 Signed-off-by: Kai Huang <ahkcs@amazon.com>
Contributor
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Swiddis
approved these changes
Jun 11, 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.
Summary
DateTimeComparisonITbuilds its TIME/DATE/TIMESTAMP comparison parameters withLocalDate.now().toString()(JVM-local zone).CURRENT_DATEthrough DataFusion using UTC.expected=true got=false(and the inverse).LocalDate.now(ZoneOffset.UTC)so the test parameters use the same date the engine uses, regardless of when or where the run starts. Pure test fix; no production code touched.Before / After
CalciteDateTimeComparisonITagainst the analytics-engine route, run started at 18:43 PDT on 2026-06-10 (UTC date already 2026-06-11):The 24 failures previously fell into two report buckets keyed on the assertion message (one for
true-expected, one forfalse-expected), each with 12 instances — e.g.TIME('00:00:00') = DATE('2026-06-10') => trueandTIME('00:00:00') != DATE('2026-06-10') => false. Both buckets evaporate with this change.Test plan
./gradlew :integ-test:integTestRemote --tests 'org.opensearch.sql.calcite.remote.CalciteDateTimeComparisonIT'against an analytics-engine cluster — 191/0/0.grep 'LocalDate.now()' DateTimeComparisonIT.javareturns no matches after the change (all 14 use sites updated).