thswlsqls opened a new pull request, #8645:
URL: https://github.com/apache/paimon/pull/8645

   ### Purpose
   
   fix #8644
   
   - `PaimonTimestampObjectInspector.getPrimitiveJavaObject()` (Hive 3.1) 
computed nano-of-second with `millis % 1000`, negative for pre-1970 timestamps 
that Paimon stores as a negative `millisecond`.
   - The negative `nanos` made Hive 3.1 `Timestamp.ofEpochMilli(long,int)` 
throw `DateTimeException` via `LocalDateTime.withNano`, so a valid `SELECT` of 
a pre-epoch fractional TIMESTAMP crashed.
   - Use `Math.floorMod(millis, 1000L)` to keep sub-second nanos in `[0, 
999_999_999]`; the positive path is unchanged (`floorMod == %` for non-negative 
millis).
   - Matches `paimon-hive-connector-common`, which delegates to 
`java.sql.Timestamp` and already handles negative millis.
   
   ### Tests
   
   - Added `PaimonTimestampObjectInspectorTest` covering the pre-epoch 
regression, the unchanged post-1970 path, and null; expected Hive `Timestamp` 
values are derived from the source `LocalDateTime` via an independent 
epoch-second path.
   - `mvn -pl paimon-hive/paimon-hive-connector-3.1 clean install` (JDK 11) — 3 
new unit tests pass, checkstyle/spotless/rat clean. The module `*ITCase` tests 
need a HiveServer and are covered by CI.
   


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

Reply via email to