hongzhi-gao commented on code in PR #767:
URL: https://github.com/apache/tsfile/pull/767#discussion_r3043166268


##########
cpp/src/cwrapper/tsfile_cwrapper.h:
##########
@@ -104,6 +104,97 @@ typedef struct device_schema {
     int timeseries_num;
 } DeviceSchema;
 
+/**
+ * @brief Aggregated statistic for one timeseries (subset of C++ Statistic).
+ *
+ * String pointers str_* are allocated with malloc; freed by
+ * tsfile_free_device_timeseries_metadata_map (do not free individually).
+ */
+typedef struct TimeseriesStatistic {
+    bool has_statistic;
+    int32_t row_count;
+    int64_t start_time;
+    int64_t end_time;
+    /** True when @p sum is meaningful (numeric / boolean aggregate types). */
+    bool sum_valid;
+    /** Sum when sum_valid; boolean uses sum of true as int-like aggregate. */
+    double sum;
+
+    /** INT32, DATE, INT64, TIMESTAMP: min/max/first/last in int64_t form. */
+    bool int_range_valid;
+    int64_t min_int64;
+    int64_t max_int64;
+    int64_t first_int64;
+    int64_t last_int64;
+
+    /** FLOAT, DOUBLE: min/max/first/last. */
+    bool float_range_valid;
+    double min_float64;
+    double max_float64;
+    double first_float64;
+    double last_float64;
+
+    /** BOOLEAN: first/last sample values. */
+    bool bool_ext_valid;
+    bool first_bool;
+    bool last_bool;
+
+    /** STRING: min/max lexicographic; TEXT: first/last only (min/max unused).
+     */
+    bool str_ext_valid;
+    char* str_min;
+    char* str_max;
+    char* str_first;
+    char* str_last;
+} TimeseriesStatistic;

Review Comment:
   fixed



-- 
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]

Reply via email to