NIFI-15305 Fix PutDatabaseRecord Timestamp Parsing #10613
+91
−77
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
NIFI-15305 Fixes PutDatabaseRecord's inconsistent timestamp parsing when handling epoch timestamps.
Epoch timestamps are supposed to be in milliseconds, but when fractional milliseconds are included in the timestamp it is incorrectly handled as seconds resulting in dates very far in the future.
Behavior prior to my patch:
Correct handling of a timestamp with only whole milliseconds:
{"ts": 1765056655230}Timestamp loaded into PostgreSQL:
2025-12-06 16:30:55.230 -0500✅Incorrect handling of a timestamp that includes fractional milliseconds:
{"ts": 1765056655230.746}Timestamp loaded into PostgreSQL:
57902-06-03 07:20:30746. -0400❌This bug was introduced in #8332, which was trying to allow for microsecond precision for epoch timestamps. Before #8332, the fractional milliseconds were truncated as the timestamp was always converted from
Stringtolong.My implementation allows for microsecond precision while handling all epoch timestamps as milliseconds.
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000Pull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
./mvnw clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation