feat(core): Java ILP client nanos precision#6220
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughRefactors timestamp emission in line protocol senders by centralizing formatting into putTimestamp(...) helpers, adds an overload to write Instant-based timestamp columns, introduces HTTP sender backoff configuration fields and a public isNotFound(...) utility, extends tests to cover cross-unit timestamp ingestion, and updates related binary test fixtures. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant Sender as AbstractLine*Sender
participant TS as putTimestamp(...)
participant Buf as Output Buffer
Caller->>Sender: at(value, unit) / at(Instant)
Sender->>TS: putTimestamp(value, unit or Instant)
TS->>Buf: write timestamp + unit suffix
Buf-->>Sender: appended
Sender-->>Caller: return (fluent)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
core/src/main/java/io/questdb/cutlass/line/AbstractLineTcpSender.java
Outdated
Show resolved
Hide resolved
core/src/main/java/io/questdb/cutlass/line/tcp/TableStructureAdapter.java
Show resolved
Hide resolved
|
I've tested this PR against the upcoming |
…if no designated ts is sent by the client
core/src/main/java/io/questdb/cutlass/line/http/AbstractLineHttpSender.java
Show resolved
Hide resolved
core/src/main/java/io/questdb/std/datetime/microtime/Micros.java
Outdated
Show resolved
Hide resolved
core/src/test/java/io/questdb/test/cutlass/line/tcp/LineTcpInsertOtherTypesTest.java
Show resolved
Hide resolved
bluestreak01
left a comment
There was a problem hiding this comment.
this PR needs a little cleanup
[PR Coverage check]😍 pass : 229 / 242 (94.63%) file detail
|
Protocol v2:
Micros (and everything else) should be sent as micros.
This way if the user sends nanos for
TIMESTAMP_NSand micros forTIMESTAMPcolumns, the data gets ingested without conversion and/or handling ofArithmeticExceptions.Protocol v1:
Data always gets stored with micros precision, unless the designated timestamp column is created manually with
TIMESTAMP_NStype.Server changes:
If the data is sent in nanos, the column type will be
TIMESTAMP_NS.If the data is sent in micros, the column type will be
TIMESTAMP.If the client does not send designated timestamp on the row which creates the table or column, the server falls back to the
precisionparam sent in the query string, or to the config propertyline.timestamp.default.column.typein case of TCP protocol, and those will determine the type of the designated timestamp.Bugfixes:
Also have to check for
longoverflow when ingesting intoTIMESTAMP_NScolumn. Currently if there is an overflow, we insert incorrect timestamps instead of reporting an error.Also fixing the
reset()method on the HTTP sender. It did not reset the state toEMPTY.