Repository navigation
Fix timestamp-to-date conversion - #7820
Conversation
|
Lifting this to 2.20 |
|
Shouldn't this be fixed in the getDate function? |
convertData already copied a Timestamp or java.sql.Date to a plain java.util.Date when the destination type is Date. convertDataCompatible, used when Stream Lookup coerces a key, still returned the source value. Both paths now share that copy. Timestamp fields still return the original Timestamp, nanoseconds included.
|
Analysis of where a Timestamp becomes a Date, for #5651.
Two Hop paths meet that rule in different places. Reading a field whose metadata is still Timestamp. Converting into a field whose metadata is Date. Select Values does this with
The normalization is in the two conversion methods, and only when the destination type is Date. A The branch now contains current |
Summary
java.util.Datewhen converting timestamp data to Date metadataRoot 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:checkgit diff --checkCloses #5651