Uh oh!
There was an error while loading. Please reload this page.
Support table-model OBJECT writes and OBJECT result decoding - #12
Open
CritasWang wants to merge 1 commit into
Open
Support table-model OBJECT writes and OBJECT result decoding#12CritasWang wants to merge 1 commit into
CritasWang wants to merge 1 commit into
Conversation
Mirrors apache/iotdb-client-go#175, apache/iotdb-client-nodejs#25 and apache/iotdb-client-csharp#64. - TSDataType::Object = 12 (official TSFile code) and 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 for the "(Object) 1.00 KB" display format. - Tablet::build_object_value / set_object_value_at with column/row/offset validation; set_object_value_at overwrites null cells, which clears the derived null bitmap bit. serialize_values writes OBJECT columns with the same 4-byte length-prefixed binary layout as BLOB. - TsBlock BinaryArray decoding accepts OBJECT; SessionDataSet formats select file OBJECT metadata as Value::String summary while select READ_OBJECT(file) keeps returning raw Value::Blob. - Golden-byte unit tests for whole/segmented/null writes, bitmap clearing, invalid arguments, TsBlock decode and dataset display semantics; a live-server OBJECT round-trip that probes support and skips like Go's e2e. - Document OBJECT in the READMEs and demo it in the table_session example. No Thrift IDL or generated protocol changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add table-model OBJECT write support and the read-side display semantics to the Rust
client, mirroring the already-merged SDK implementations:
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], plusobject_bytes_to_stringproducing(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)andTablet::set_object_value_at(...)(GoSetObjectValueAtcounterpart) withcolumn-type / row / column / negative-offset validation. Overwriting a null cell sets
the
Optionback toSome, which clears the null bit Rust derives at serializationtime (Go's
unmarkNullValueAt).serialize_values/record serialization write OBJECT columns with the same4-byte BE length-prefixed binary layout as BLOB;
insertTabletnow sends type code 12.BinaryArraydecoding accepts OBJECT and keeps the raw 8-byte BE size +internal path;
SessionDataSet::apply_logical_typeformatsselect fileOBJECTmetadata into
Value::String("(Object) 1.00 KB")whileselect READ_OBJECT(file)still returns raw
Value::Blob.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_tripsinclude 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_placeholdersnow cover OBJECT with byte-exact expectations.tsblock::binary_array_object_metadata_and_nullsand truncated-payload error.dataset::object_column_renders_size_summary/short_object_metadata_is_decode_error; READ_OBJECT stays BLOB via the existinglogical-type retagging tests.
session::insert_tablet_request_carries_object_type_12builds the actualTSInsertTabletReqand checkstypes == [11, 12], values buffer, categories andwriteToTable.table_session::live_object_write_roundtrip: whole object, 512+512 segmentedinserts, null row,
count(*),READ_OBJECTbyte round-trip andselect filesummary; 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) andcargo test --features tls(137 passed);cargo build --example table_sessioncompiles.