CryoThrust opened a new issue, #12743:
URL: https://github.com/apache/seatunnel/issues/12743

   ### Search before asking
   
   - [x] I searched existing issues and PRs.
   
   ### What happened
   
   The InfluxDB sink assigns the configured timestamp precision to values that 
are already epoch milliseconds. This affects both omitted `key_time` 
(processing time) and a `TIMESTAMP` column selected by `key_time`.
   
   With the default nanosecond precision, `2025-01-02T03:04:05.123` becomes 
`1735787045123` **nanoseconds**, around 1970, instead of `1735787045123000000` 
nanoseconds. A seconds/minutes/hours configuration instead moves the timestamp 
far into the future and can exceed the server's timestamp range.
   
   `DefaultSerializer.createTimestampExtractor` passes 
`System.currentTimeMillis()` and `LocalDateTime.toInstant(...).toEpochMilli()` 
to `Point.Builder.time(..., precision)`. The unit supplied to this builder 
describes the input number's unit, not the requested output precision.
   
   ### Expected behavior
   
   Processing time and a `TIMESTAMP` value should retain their actual instant 
independently of `epoch`. Explicit `BIGINT` and numeric `STRING` timestamps 
should continue to use the configured unit.
   
   ### How to reproduce
   
   Create a `DefaultSerializer` with row fields `time: TIMESTAMP` and `value: 
INT`, `key_time = "time"`, and `TimeUnit.NANOSECONDS`. Serialize a row 
containing `LocalDateTime.of(2025, 1, 2, 3, 4, 5, 123_000_000)` and `1`, then 
call `Point.lineProtocol()`.
   
   ```text
   Actual:   metrics value=1i 1735787045123
   Expected: metrics value=1i 1735787045123000000
   ```
   
   The processing-time path reproduces the same unit mismatch without a 
`key_time` field. No running InfluxDB server is needed to inspect the generated 
line protocol.
   
   ### Environment and verification
   
   Reproduced against `dev` at `b3898b62d79db47d4b213c830da8745edd8fc678`, 
macOS, Corretto 11.0.25, influxdb-java 2.21.
   
   A focused regression across all six supported precisions executes 24 cases. 
With unchanged production code, 10 fail: processing time and `TIMESTAMP` under 
every non-millisecond precision. The millisecond cases and all explicit 
numeric/string timestamp controls pass.
   
   Related: #12741 fixes null timestamps, retention policy and flush retries. 
Its serializer diff does not change either affected unit assignment. This issue 
tracks the separate precision correction.
   


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