Skip to content

Fix timestamp-to-date conversion - #7820

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

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
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

1 participant