j1wonpark opened a new pull request, #4192: URL: https://github.com/apache/amoro/pull/4192
## Why are the changes needed? `TableProcessMeta.createProcessMeta()` initializes `finishTime` to `-1`. `Long2TsConverter` only converts `0` to `null`, so `Timestamp(-1)` is passed to MySQL, which is outside the valid `TIMESTAMP` range (`1970-01-01 00:00:01 UTC` ~), causing `MysqlDataTruncation`. ## Brief change log - `Long2TsConverter.setNonNullParameter()`: convert `parameter <= 0` to `null` instead of only `== 0`. Negative epoch timestamps (before 1970) are invalid for MySQL `TIMESTAMP`, so this is a safe defensive guard. - `TableProcessMeta.createProcessMeta()`: initialize `finishTime` to `0` for consistency with the `of()` factory method. Consumers already check `finishTime > 0` to determine completion. - Add `TestLong2TsConverter` with unit tests covering zero, negative, and positive parameter cases. ## How was this patch tested? - [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [x] Run test locally before making a pull request ## Documentation - Does this pull request introduce a new feature? (no) - If yes, how is the feature documented? (not applicable) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
