jt2594838 opened a new pull request, #18824: URL: https://github.com/apache/iotdb/pull/18824
## Description Add prepared numeric single-row writes to the table Session API. Applications can prepare column metadata once and repeatedly send STRING TAG values and fixed-width numeric FIELD values, with an optional FIELD null bitmap. ### Public API and behavior - Add `ITableSession.prepareInsertNumericRow(...)` and `executePreparedInsertNumericRow(...)`, including the nullable overload, to direct and pooled table sessions. - Support BOOLEAN, INT32, INT64, FLOAT, DOUBLE, DATE and TIMESTAMP FIELDs. FIELD values use `long[]`; FLOAT/DOUBLE carry raw IEEE 754 bits. TAGs use `String[]` and may be null or empty. - Keep handles bound to their physical session and original database. Release handles explicitly or when the session closes. Do not replay writes after an ambiguous transport failure. - Follow write redirection recommendations on subsequent requests, preparing a separate handle for each destination. Close the logical prepared statement when execution returns a server error. - Reuse validated metadata while the table version is unchanged. Refresh compatible versions; otherwise perform normal schema validation and invalidate the server handle when validation fails. ### Write path and coverage Preserve primitive numeric values through planning, MemTable insertion, WAL serialization/recovery and consensus replication. Extend Pipe and subscription adapters to consume the new row representation. The final API exposes only prepared numeric writes. Normalize integer DATE values to LocalDate at the subscription Tablet boundary, preserving DATE writes with the current TsFile Type API. Add opt-in benchmarks comparing prepared writes with one-row Tablets, including random-device partial-column writes, request latency, stage timing, network/disk I/O and peak CPU/RSS sampling. Benchmarks remain disabled unless explicitly enabled. The array pool retains its original behavior and has no new switch. ### Validation - 85 focused tests passed across 11 classes after integrating master `fea5bd2490a8`, covering client metadata/buffer reuse/redirection/pooling, server schema versions and handle cleanup, numeric conversion, MemTable/TVList insertion, WAL/consensus serialization and Pipe/subscription adapters. - Spotless and both default/Chinese-locale compilation passed for all modules except the distribution packaging module, including integration-test source compilation. The unrestricted reactor compile could not resolve the configured repository's server/CLI/ConfigNode ZIP snapshots; the successful run excluded only `distribution`. All Maven commands used `-Drat.skip=true`. - Before integrating the latest master, the remote Linux benchmark completed with 16 writers, 1 TAG + 999 DOUBLE FIELDs, 2 GiB DataNode heap, and Tablet batch size 1. All six row-count/non-null-value checks passed. - Each interface ran two 3-second warmups and six 5-second measured rounds in alternating order. Results below use symmetric 1/64 deep sampling and are not uninstrumented production throughput. | FIELD write ratio | Prepared rows/s | Tablet rows/s | Prepared mean latency | Tablet mean latency | | --- | ---: | ---: | ---: | ---: | | 10% (100 FIELDs) | 9,858.2 | 7,790.4 | 1.617 ms | 1.970 ms | | 50% (500 FIELDs) | 2,940.0 | 2,251.3 | 5.428 ms | 6.993 ms | | 100% (999 FIELDs) | 1,677.3 | 1,386.6 | 9.515 ms | 11.414 ms | Pipe/IoTConsensus cluster integration tests were not rerun during the final review; the focused adapter and serialization tests above passed. <hr> This PR has: - [x] been self-reviewed. - [x] documented the public API and its lifecycle/value encoding rules in Javadocs. - [x] added comments explaining non-obvious serialization, lifecycle and fast-path constraints. - [x] added or updated unit tests. - [x] added integration tests and opt-in performance tests. - [x] been tested against an isolated IoTDB instance with readback verification. <hr> ##### Key changed/added classes (or packages if there are too many classes) in this PR - `ITableSession`, `NumericRowPreparedStatement`, `TableSession`, `SessionConnection`, `TableSessionWrapper` - `PreparedNumericRowInfo`, `InsertNumericRowStatement`, `RelationalInsertNumericRowNode`, `NumericRowValues` - MemTable/TVList insertion, WAL/consensus and Pipe/subscription adapters - `IoTDBTableModelSessionIT`, `IoTDBPipeNumericRowIT` and performance resource trackers -- 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]
