jt2594838 commented on code in PR #426:
URL: https://github.com/apache/tsfile/pull/426#discussion_r1978983870


##########
cpp/src/reader/result_set.h:
##########
@@ -37,29 +49,82 @@ class ResultSetMetadata {
             this->column_types_.emplace_back(column_types[i]);
         }
     }
+    /**
+     * @brief get the column type
+     *
+     * @param column_index the column index, starting from 1
+     * @return the column type
+     */
     common::TSDataType get_column_type(uint32_t column_index) {
         ASSERT(column_index >= 1 && column_index <= column_types_.size());
         return column_types_[column_index - 1];
     }
+    /**
+     * @brief get the column name
+     *
+     * @param column_index the column index, starting from 1
+     * @return the column name
+     */
     std::string get_column_name(uint32_t column_index) {
         ASSERT(column_index >= 1 && column_index <= column_names_.size());
         return column_names_[column_index - 1];
     }
+    /**
+     * @brief get the column count
+     *
+     * @return the column count by uint32_t
+     */
     uint32_t get_column_count() { return column_names_.size(); }
 
    private:
     std::vector<std::string> column_names_;
     std::vector<common::TSDataType> column_types_;
 };
 
+/**
+ * @brief ResultSet is the query result of the TsfileReader.It provides access
+ * to the results.
+ *
+ * ResultSet is a virtual class. Convert it to the corresponding implementation
+ * class when used
+ * @note If it is a tree model and the filter condition is global time filter,
+ * it should be cast as QDSWithoutTimeGenerator.
+ * @note If the filter condition is not global time filter, it should be
+ * QDSWithoutTimeGenerator.
+ * @note If the query uses a table model, the cast should be TableResultSet
+ */
 class ResultSet {
    public:
     ResultSet() {}
     virtual ~ResultSet() {}
+    /**
+     * @brief Get the next row of the result set
+     *
+     * @param has_next a boolean value indicating if there is a next row

Review Comment:
   Output arguments should be explicitly marked, like "has_next[out]".
   If a method is mixed with input and outputs, they should be marked 
separately.
   Check other places.



##########
cpp/src/reader/result_set.h:
##########
@@ -37,29 +49,82 @@ class ResultSetMetadata {
             this->column_types_.emplace_back(column_types[i]);
         }
     }
+    /**
+     * @brief get the column type
+     *
+     * @param column_index the column index, starting from 1
+     * @return the column type
+     */
     common::TSDataType get_column_type(uint32_t column_index) {
         ASSERT(column_index >= 1 && column_index <= column_types_.size());
         return column_types_[column_index - 1];
     }
+    /**
+     * @brief get the column name
+     *
+     * @param column_index the column index, starting from 1
+     * @return the column name
+     */
     std::string get_column_name(uint32_t column_index) {
         ASSERT(column_index >= 1 && column_index <= column_names_.size());
         return column_names_[column_index - 1];
     }
+    /**
+     * @brief get the column count
+     *
+     * @return the column count by uint32_t
+     */
     uint32_t get_column_count() { return column_names_.size(); }
 
    private:
     std::vector<std::string> column_names_;
     std::vector<common::TSDataType> column_types_;
 };
 
+/**
+ * @brief ResultSet is the query result of the TsfileReader.It provides access
+ * to the results.
+ *
+ * ResultSet is a virtual class. Convert it to the corresponding implementation
+ * class when used
+ * @note If it is a tree model and the filter condition is global time filter,
+ * it should be cast as QDSWithoutTimeGenerator.
+ * @note If the filter condition is not global time filter, it should be
+ * QDSWithoutTimeGenerator.

Review Comment:
   not global time filter -> not a global time filter
   QDSWithoutTimeGenerator -> QDSWithTimeGenerator (?)



##########
cpp/src/reader/result_set.h:
##########
@@ -37,29 +49,82 @@ class ResultSetMetadata {
             this->column_types_.emplace_back(column_types[i]);
         }
     }
+    /**
+     * @brief get the column type
+     *
+     * @param column_index the column index, starting from 1
+     * @return the column type
+     */
     common::TSDataType get_column_type(uint32_t column_index) {
         ASSERT(column_index >= 1 && column_index <= column_types_.size());
         return column_types_[column_index - 1];
     }
+    /**
+     * @brief get the column name
+     *
+     * @param column_index the column index, starting from 1
+     * @return the column name
+     */
     std::string get_column_name(uint32_t column_index) {
         ASSERT(column_index >= 1 && column_index <= column_names_.size());
         return column_names_[column_index - 1];
     }
+    /**
+     * @brief get the column count
+     *
+     * @return the column count by uint32_t
+     */
     uint32_t get_column_count() { return column_names_.size(); }
 
    private:
     std::vector<std::string> column_names_;
     std::vector<common::TSDataType> column_types_;
 };
 
+/**
+ * @brief ResultSet is the query result of the TsfileReader.It provides access
+ * to the results.
+ *
+ * ResultSet is a virtual class. Convert it to the corresponding implementation
+ * class when used
+ * @note If it is a tree model and the filter condition is global time filter,
+ * it should be cast as QDSWithoutTimeGenerator.
+ * @note If the filter condition is not global time filter, it should be
+ * QDSWithoutTimeGenerator.
+ * @note If the query uses a table model, the cast should be TableResultSet
+ */
 class ResultSet {
    public:
     ResultSet() {}
     virtual ~ResultSet() {}
+    /**
+     * @brief Get the next row of the result set
+     *
+     * @param has_next a boolean value indicating if there is a next row
+     * @return Returns 0 on success, or a non-zero error code on failure.
+     */
     virtual int next(bool& has_next) = 0;
+    /**
+     * @brief Check if the value of the column is null by column name
+     *
+     * @param column_name the name of the column
+     * @return true if the value is null, false otherwise
+     */
     virtual bool is_null(const std::string& column_name) = 0;
+    /**
+     * @brief Check if the value of the column is null by column index
+     *
+     * @param column_index the index of the column

Review Comment:
   starting from 1.



##########
cpp/src/reader/result_set.h:
##########
@@ -37,29 +49,82 @@ class ResultSetMetadata {
             this->column_types_.emplace_back(column_types[i]);
         }
     }
+    /**
+     * @brief get the column type
+     *
+     * @param column_index the column index, starting from 1
+     * @return the column type
+     */
     common::TSDataType get_column_type(uint32_t column_index) {
         ASSERT(column_index >= 1 && column_index <= column_types_.size());
         return column_types_[column_index - 1];
     }
+    /**
+     * @brief get the column name
+     *
+     * @param column_index the column index, starting from 1
+     * @return the column name
+     */
     std::string get_column_name(uint32_t column_index) {
         ASSERT(column_index >= 1 && column_index <= column_names_.size());
         return column_names_[column_index - 1];
     }
+    /**
+     * @brief get the column count
+     *
+     * @return the column count by uint32_t
+     */
     uint32_t get_column_count() { return column_names_.size(); }
 
    private:
     std::vector<std::string> column_names_;
     std::vector<common::TSDataType> column_types_;
 };
 
+/**
+ * @brief ResultSet is the query result of the TsfileReader.It provides access

Review Comment:
   TsfileReader.It -> TsfileReader. It



##########
cpp/src/reader/result_set.h:
##########
@@ -37,29 +49,82 @@ class ResultSetMetadata {
             this->column_types_.emplace_back(column_types[i]);
         }
     }
+    /**
+     * @brief get the column type
+     *
+     * @param column_index the column index, starting from 1
+     * @return the column type
+     */
     common::TSDataType get_column_type(uint32_t column_index) {
         ASSERT(column_index >= 1 && column_index <= column_types_.size());
         return column_types_[column_index - 1];
     }
+    /**
+     * @brief get the column name
+     *
+     * @param column_index the column index, starting from 1
+     * @return the column name
+     */
     std::string get_column_name(uint32_t column_index) {
         ASSERT(column_index >= 1 && column_index <= column_names_.size());
         return column_names_[column_index - 1];
     }
+    /**
+     * @brief get the column count
+     *
+     * @return the column count by uint32_t
+     */
     uint32_t get_column_count() { return column_names_.size(); }
 
    private:
     std::vector<std::string> column_names_;
     std::vector<common::TSDataType> column_types_;
 };
 
+/**
+ * @brief ResultSet is the query result of the TsfileReader.It provides access
+ * to the results.
+ *
+ * ResultSet is a virtual class. Convert it to the corresponding implementation
+ * class when used
+ * @note If it is a tree model and the filter condition is global time filter,
+ * it should be cast as QDSWithoutTimeGenerator.

Review Comment:
   If it is a tree model .. filter, -> When using the tree model and the filter 
is a global time filter,
   



##########
cpp/src/reader/tsfile_reader.h:
##########
@@ -36,29 +36,108 @@ namespace storage {
 
 extern int libtsfile_init();
 extern void libtsfile_destroy();
-
+/**
+ * @brief TsfileReader provides the ability to query all files with the suffix
+ * .tsfile
+ *
+ * TsfileReader is designed to query.tsfile files, it accepts tree model
+ * queries and table model queries, and supports querying metadata such as
+ * TableSchema and TimeseriesSchema.
+ */
 class TsFileReader {
    public:
     TsFileReader();
     ~TsFileReader();
+    /**
+     * @brief open the tsfile file
+     *
+     * @param file_path the path of the tsfile file which will be opened
+     * @return Returns 0 on success, or a non-zero error code on failure.
+     */
     int open(const std::string &file_path);
+    /**
+     * @brief close the tsfile file, this method should be called after the
+     * query is finished
+     *
+     * @return Returns 0 on success, or a non-zero error code on failure.
+     */
     int close();
+    /**
+     * @brief query the tsfile file by the query expression,Users can construct
+     * their own query expressions to query tsfile
+     *
+     * @param qe the query expression
+     * @param ret_qds the result set
+     * @return Returns 0 on success, or a non-zero error code on failure.
+     */
     int query(storage::QueryExpression *qe, ResultSet *&ret_qds);
+    /**
+     * @brief query the tsfile file by the path list, start time and end time
+     * this method is used to query the tsfile file by the tree model.

Review Comment:
   tsfile file -> tsfile



##########
cpp/src/reader/tsfile_reader.h:
##########
@@ -36,29 +36,108 @@ namespace storage {
 
 extern int libtsfile_init();
 extern void libtsfile_destroy();
-
+/**
+ * @brief TsfileReader provides the ability to query all files with the suffix
+ * .tsfile
+ *
+ * TsfileReader is designed to query.tsfile files, it accepts tree model

Review Comment:
   query.tsfile -> query. tsfile



##########
cpp/src/reader/result_set.h:
##########
@@ -25,9 +25,21 @@
 #include "common/row_record.h"
 
 namespace storage {
-
+/**
+ * @brief metadata of result set
+ *
+ * user can obtain the metadata from ResultSetMetadata, including all column
+ * names and data types. When a user uses a table model, the first column

Review Comment:
   a table model -> the table model
   check other places



-- 
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: notifications-unsubscr...@tsfile.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to