Skip to content

Conversation

@hongzhi-gao
Copy link
Contributor

  1. Implement new cpp tree-model interface. Tested in TEST_F(TsFileTreeReaderTest, ExtendedRowsAndColumnsTest)
  2. Renamed Java-Edition recordIterator() to iterator()
  3. Marked get_device_schema interface with existing bug

@ColinLeeo ColinLeeo requested a review from Copilot November 6, 2025 10:13
Copy link
Contributor

Copilot AI left a 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() to ResultSet.iterator() in both Java and C++ implementations
  • Added new TsFileTreeWriter and TsFileTreeReader classes for C++ to support hierarchical time-series data
  • Introduced ResultSetIterator class 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
Copy link

Copilot AI Nov 6, 2025

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'.

Suggested change
* with the License. You may obtain a copy of the License a
* with the License. You may obtain a copy of the License at

Copilot uses AI. Check for mistakes.
}

int TsFileTreeWriter::write(const TsRecord& record) {
return tsfile_writer_->write_record(record);
Copy link

Copilot AI Nov 6, 2025

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.

Suggested change
return tsfile_writer_->write_record(record);
return tsfile_writer_->write_tree(record);

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@hongzhi-gao hongzhi-gao merged commit da7cd08 into apache:develop Nov 7, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants