-
Notifications
You must be signed in to change notification settings - Fork 89
Feature/new cpp interface #627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/new cpp interface #627
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the method for obtaining an iterator from a ResultSet by renaming recordIterator() to iterator() and adds new tree-view reader/writer classes for C++. The changes improve API consistency by aligning with standard iterator naming conventions.
Key changes:
- Renamed
ResultSet.recordIterator()toResultSet.iterator()in both Java and C++ implementations - Added new
TsFileTreeWriterandTsFileTreeReaderclasses for C++ to support hierarchical time-series data - Introduced
ResultSetIteratorclass in C++ with smart pointer support - Refactored internal
row_record_field management across ResultSet implementations
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| java/tsfile/src/main/java/org/apache/tsfile/read/query/dataset/ResultSet.java | Renamed interface method from recordIterator() to iterator() |
| java/tsfile/src/main/java/org/apache/tsfile/read/query/dataset/TreeResultSet.java | Updated implementation to match renamed interface method |
| java/tsfile/src/main/java/org/apache/tsfile/read/query/dataset/TableResultSet.java | Updated implementation to match renamed interface method |
| java/tsfile/src/test/java/org/apache/tsfile/read/query/ResultSetTest.java | Updated test to use renamed method |
| java/tsfile/src/test/java/org/apache/tsfile/read/TsFileTreeReaderTest.java | Updated test to use renamed method |
| java/examples/src/main/java/org/apache/tsfile/v4/TsFileTreeReaderExample.java | Updated example to use renamed method |
| cpp/src/reader/result_set.h | Added ResultSetIterator class and moved row_record_ field to base class |
| cpp/src/reader/qds_without_timegenerator.h | Removed duplicate row_record_ field |
| cpp/src/reader/qds_with_timegenerator.h | Removed duplicate row_record_ field |
| cpp/src/reader/table_result_set.h | Removed duplicate row_record_ field and unused include |
| cpp/src/writer/tsfile_tree_writer.h | New file providing tree-structured writer interface |
| cpp/src/writer/tsfile_tree_writer.cc | Implementation of TsFileTreeWriter |
| cpp/src/reader/tsfile_tree_reader.h | New file providing tree-structured reader interface |
| cpp/src/reader/tsfile_tree_reader.cc | Implementation of TsFileTreeReader |
| cpp/src/writer/tsfile_writer.h | Added write_tree() methods for Tablet and TsRecord |
| cpp/src/writer/tsfile_writer.cc | Implementation of write_tree() methods |
| cpp/src/reader/tsfile_reader.h | Added get_all_device_ids() method |
| cpp/src/reader/tsfile_reader.cc | Implementation of get_all_device_ids() |
| cpp/src/common/record.h | Added alternative constructor for TsRecord |
| cpp/test/reader/tree_view/tsfile_reader_tree_test.cc | New test file for tree reader functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * License); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License a |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incomplete license text: 'License a' should be 'License at'.
| * with the License. You may obtain a copy of the License a | |
| * with the License. You may obtain a copy of the License at |
cpp/src/writer/tsfile_tree_writer.cc
Outdated
| } | ||
|
|
||
| int TsFileTreeWriter::write(const TsRecord& record) { | ||
| return tsfile_writer_->write_record(record); |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should call write_tree(record) instead of write_record(record) to be consistent with the Tablet overload (line 42) and to properly handle aligned vs non-aligned records. The write_tree method checks the schema alignment and dispatches to the correct method.
| return tsfile_writer_->write_record(record); | |
| return tsfile_writer_->write_tree(record); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
…o properly handle aligned vs non-aligned records.
…le into feature/new-cpp-interface
TEST_F(TsFileTreeReaderTest, ExtendedRowsAndColumnsTest)