hongzhi-gao opened a new pull request, #18533: URL: https://github.com/apache/iotdb/pull/18533
## Description Before inserting a Tablet, drop FIELD columns that are entirely null within `[0, rowSize)`. TAG / ATTRIBUTE columns are always kept. This avoids shipping unused measurement columns when the client schema is wide but each batch only fills a subset of fields. ### Behavior - If nothing needs to be dropped, return the original Tablet (no copy). - If some FIELD columns are dropped, return a new Tablet with only the kept columns. - If every FIELD column is null, skip the insert (return null / empty and log a warning where applicable). - Does not mutate the caller-owned Tablet. ### Multi-language clients Aligned the same logic in Java / C++ / Python Session insert tablet paths (`insertTablet` / `insertTablets` / aligned / relational where applicable). C API goes through the C++ Session, so no separate implementation. ### Design notes - Logic lives in `SessionUtils.filterNullColumns` (Java / C++) and `filter_null_columns` (Python), and is invoked when building insert requests after sort. - C++ returns `std::shared_ptr<const Tablet>` (non-owning empty deleter for the original tablet; owning shared_ptr for a filtered copy) instead of a raw pointer + out-parameter. <hr> This PR has: - [x] been self-reviewed. - [x] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage. - [ ] added documentation for new or modified features or behaviors. - [ ] 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 - `org.apache.iotdb.session.util.SessionUtils` - `org.apache.iotdb.session.Session` - `iotdb-client/client-cpp` `SessionUtils::filterNullColumns` / `Session` - `iotdb.utils.SessionUtils` (Python) - Unit tests: `SessionUtilsTest` (Java), `sessionUtilsTest` (C++), `test_session_utils.py` (Python) -- 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]
