Skip to content

Fix timestamp-to-date conversion - #7820

Draft
gvdutra wants to merge 3 commits into
apache:mainfrom
gvdutra:5651-convert-timestamp-to-date
Draft

Fix timestamp-to-date conversion#7820
gvdutra wants to merge 3 commits into
apache:mainfrom
gvdutra:5651-convert-timestamp-to-date

Conversation

@gvdutra

@gvdutra gvdutra commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • return a plain java.util.Date when converting timestamp data to Date metadata
  • keep timestamp access and JDBC timestamp writes unchanged
  • add regression coverage for conversion, null handling, and JDBC writes

Root cause

Date conversion delegated directly to the source metadata. For timestamp fields, that returned the original java.sql.Timestamp, so the field metadata changed to Date while the runtime value did not.

The conversion is now normalized only when the destination type is Date, avoiding changes to timestamp consumers and preserving timestamp precision in existing database paths.

Validation

  • ./mvnw -pl core -Dtest=ValueMetaTimestampTest test
  • ./mvnw -pl core test
  • ./mvnw -pl core -DskipTests spotless:check
  • git diff --check

Closes #5651

@gvdutra
gvdutra marked this pull request as ready for review August 8, 2026 03:48
@hansva
hansva marked this pull request as draft August 10, 2026 06:58
@hansva

hansva commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Lifting this to 2.20

@hansva hansva added this to the 2.20 milestone Aug 10, 2026
@hansva

hansva commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Shouldn't this be fixed in the getDate function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Converting a Timestamp to a Date doesn't do anything

2 participants