Skip to content

fix: include resultFormat and joda in TimeDimExtractionFn cache key - #20891

Merged
gianm merged 2 commits into
apache:masterfrom
amaechler:fix-timedim-extraction-cache-key
Dec 3, 2026
Merged

gianm merged 2 commits into
apache:masterfrom
amaechler:fix-timedim-extraction-cache-key

Conversation

@amaechler

Copy link
Copy Markdown
Contributor

Description

The time extraction function (TimeDimExtractionFn) built its cache key from timeFormat only. Two functions with the same timeFormat but a different resultFormat or joda setting got the same key, so a query could be served cached results in the wrong output format.

The cache key now includes all three fields. Existing cache entries for this function will miss once after upgrading.

Release note

Fixed a bug where queries using the time extraction function could return cached results computed with a different resultFormat or joda setting.


Key changed/added classes in this PR
  • TimeDimExtractionFn

This PR has:

  • been self-reviewed.
  • a release note entry in the PR description.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.

getCacheKey() only covered timeFormat, so two time extraction functions that
differed only in resultFormat or joda produced the same cache key and could
be served each other's cached results. Build the key with CacheKeyBuilder
from all three fields.

@FrankChen021 FrankChen021 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No actionable issues found in this review. The cache key now distinguishes all three TimeDimExtractionFn fields that affect parsing and formatting, and the added test covers the relevant differences.

Reviewed 2 of 2 changed files.

Validation: git diff --check passed for the supplied PR diff; no tests or builds were run.


This is an automated review by Codex GPT-5.6-Luna(max)

@FrankChen021 FrankChen021 added the Approval Recommended Used when AI completes a review and reports no findings label Nov 13, 2026

@FrankChen021 FrankChen021 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No actionable issues found in this review. The cache key now distinguishes all three fields affecting TimeDimExtractionFn, and the regression test covers equality plus differences in each field.

Reviewed 2 of 2 changed files. The incremental diff's 401 paths were upstream merge synchronization and excluded from the PR-specific count.

Validation: git diff --check passed; no tests or builds were run.


This is an automated review by Codex GPT-5.6-Luna(max)

@gianm
gianm merged commit 3745b21 into apache:master Dec 3, 2026
28 checks passed
@github-actions github-actions Bot added this to the 40.0.0 milestone Dec 3, 2026
@amaechler
amaechler deleted the fix-timedim-extraction-cache-key branch December 3, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approval Recommended Used when AI completes a review and reports no findings Area - Cache Bug Release Notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants