CritasWang opened a new pull request, #12: URL: https://github.com/apache/iotdb-client-rust/pull/12
## Summary Add table-model **OBJECT** write support and the read-side display semantics to the Rust client, mirroring the already-merged SDK implementations: - Go: https://github.com/apache/iotdb-client-go/pull/175 - Node.js: https://github.com/apache/iotdb-client-nodejs/pull/25 - C#: https://github.com/apache/iotdb-client-csharp/pull/64 No Thrift IDL / generated `src/protocol/` changes. ## What changed - `TSDataType::Object = 12` (official TSFile code) + `from_code`. - `Value::Object(Vec<u8>)` carrying the **already-framed** OBJECT segment `[1 byte isEOF][8 byte big-endian offset][content]`, plus `object_bytes_to_string` producing `(Object) 1023 B` / `(Object) 1.00 KB` / `(Object) 1.00 MB` / `(Object) 1.00 GB` (same thresholds as Go/Node/C#). - `Tablet::build_object_value(is_eof, offset, content)` and `Tablet::set_object_value_at(...)` (Go `SetObjectValueAt` counterpart) with column-type / row / column / negative-offset validation. Overwriting a null cell sets the `Option` back to `Some`, which clears the null bit Rust derives at serialization time (Go's `unmarkNullValueAt`). - `serialize_values`/record serialization write OBJECT columns with the same 4-byte BE length-prefixed binary layout as BLOB; `insertTablet` now sends type code 12. - TsBlock `BinaryArray` decoding accepts OBJECT and keeps the raw 8-byte BE size + internal path; `SessionDataSet::apply_logical_type` formats `select file` OBJECT metadata into `Value::String("(Object) 1.00 KB")` while `select READ_OBJECT(file)` still returns raw `Value::Blob`. - Documentation in README/README_ZH and an OBJECT demo in `examples/table_session.rs` (probes server support and skips on IoTDB < 2.0.8, keeping CI green on 2.0.6). ## Tests Golden-byte / mock tests (no server): - `data_type_codes_match_spec` / `data_type_from_code_round_trips` include 12. - `value::object_bytes_to_string_*` unit boundaries and short-input error. - `tablet::build_object_value_frames_segments`, `set_object_value_at_writes_whole_and_segmented_rows`, `set_object_value_at_clears_previously_null_cell`, `set_object_value_at_rejects_invalid_inputs`; `all_types_known_bytes` / `all_types_null_placeholders` now cover OBJECT with byte-exact expectations. - `tsblock::binary_array_object_metadata_and_nulls` and truncated-payload error. - `dataset::object_column_renders_size_summary` / `short_object_metadata_is_decode_error`; READ_OBJECT stays BLOB via the existing logical-type retagging tests. - `session::insert_tablet_request_carries_object_type_12` builds the actual `TSInsertTabletReq` and checks `types == [11, 12]`, values buffer, categories and `writeToTable`. - `table_session::live_object_write_roundtrip`: whole object, 512+512 segmented inserts, null row, `count(*)`, `READ_OBJECT` byte round-trip and `select file` summary; probes OBJECT support and skips exactly like Go PR 175's e2e. Local verification: `cargo fmt`, `cargo clippy --all-targets -- -D warnings` (default and `--features tls`), `./tools/check-license.sh`, `cargo test` (126 passed) and `cargo test --features tls` (137 passed); `cargo build --example table_session` compiles. -- 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]
