hongzhi-gao opened a new pull request, #17338:
URL: https://github.com/apache/iotdb/pull/17338
## Description
This PR adds `OBJECT` type support to the Python session client for both
write and read paths, and adds test coverage for object-type serialization and
round-trip query behavior.
### Content1: Add OBJECT type definition and write-path support
- Added `TSDataType.OBJECT = 12` in Python constants to align with
server-side enum semantics.
- Extended write serialization in:
- `Session.value_to_bytes()` (`iotdb-client/client-py/iotdb/Session.py`)
- `Tablet.get_binary_values()`
(`iotdb-client/client-py/iotdb/utils/Tablet.py`)
- `NumpyTablet.get_binary_values()`
(`iotdb-client/client-py/iotdb/utils/NumpyTablet.py`)
- Design choice: treat `OBJECT` as binary payload (length-prefixed bytes),
consistent with existing TEXT/STRING/BLOB binary transport pattern and
Java-side session behavior.
### Content2: Add OBJECT type read-path support
- Extended TsBlock decoding to accept and parse `OBJECT` columns:
- `read_column_types()` and `read_binary_column()` in
`iotdb-client/client-py/iotdb/tsfile/utils/tsblock_serde.py`
- Extended dataset conversion and field access:
- `iotdb-client/client-py/iotdb/utils/iotdb_rpc_dataset.py`
- `iotdb-client/client-py/iotdb/utils/Field.py`
- `iotdb-client/client-py/iotdb/utils/SessionDataSet.py`
- Design choice: return `OBJECT` as raw `bytes` in Python APIs (same
practical behavior as BLOB-style handling) for deterministic round-trip
verification.
### Content3: Tests for OBJECT type
- Added integration test:
- `iotdb-client/client-py/tests/integration/test_object_type.py`
- Covers write and read round-trip for OBJECT values using `Tablet`,
`NumpyTablet`, and record APIs.
- Extended unit test:
- `iotdb-client/client-py/tests/unit/test_numpy_tablet.py`
- Verifies OBJECT serialization parity between `Tablet` and `NumpyTablet`.
<hr>
This PR has:
- [ ] been self-reviewed.
- [ ] added documentation for new or modified features or behaviors.
- [ ] added comments explaining the "why" and the intent of the code
wherever would not be obvious for an unfamiliar reader.
- [x] added unit tests or modified existing tests to cover new code paths,
ensuring the threshold for code coverage.
- [x] added integration tests.
- [ ] been tested in a test IoTDB cluster.
<hr>
##### Key changed/added classes (or packages if there are too many classes)
in this PR
- `iotdb-client/client-py/iotdb/utils/IoTDBConstants.py`
- `iotdb-client/client-py/iotdb/Session.py`
- `iotdb-client/client-py/iotdb/utils/Tablet.py`
- `iotdb-client/client-py/iotdb/utils/NumpyTablet.py`
- `iotdb-client/client-py/iotdb/tsfile/utils/tsblock_serde.py`
- `iotdb-client/client-py/iotdb/utils/iotdb_rpc_dataset.py`
- `iotdb-client/client-py/iotdb/utils/Field.py`
- `iotdb-client/client-py/iotdb/utils/SessionDataSet.py`
- `iotdb-client/client-py/tests/integration/test_object_type.py`
- `iotdb-client/client-py/tests/unit/test_numpy_tablet.py`
--
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]