jack870131 commented on a change in pull request #713: [IOTDB-418] New series 
reader
URL: https://github.com/apache/incubator-iotdb/pull/713#discussion_r378856713
 
 

 ##########
 File path: 
server/src/main/java/org/apache/iotdb/db/query/aggregation/AggregateResult.java
 ##########
 @@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * 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 at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.query.aggregation;
+
+import org.apache.iotdb.db.exception.query.QueryProcessException;
+import org.apache.iotdb.db.query.reader.series.IReaderByTimestamp;
+import org.apache.iotdb.tsfile.exception.write.UnSupportedDataTypeException;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.statistics.Statistics;
+import org.apache.iotdb.tsfile.read.common.BatchData;
+import org.apache.iotdb.tsfile.utils.Binary;
+
+import java.io.IOException;
+
+public abstract class AggregateResult {
+
+  protected TSDataType dataType;
+
+  private boolean booleanRet;
+  private int intRet;
+  private long longRet;
+  private float floatRet;
+  private double doubleRet;
+  private Binary binaryRet;
+
+  private boolean hasResult;
+
+  /**
+   * construct.
+   *
+   * @param dataType result data type.
+   */
+  public AggregateResult(TSDataType dataType) {
+    this.dataType = dataType;
+    this.hasResult = false;
+  }
+
+  public abstract Object getResult();
+
+  /**
+   * Calculate the aggregation using Statistics
+   *
+   * @param statistics chunkStatistics or pageStatistics
+   */
+  public abstract void updateResultFromStatistics(Statistics statistics)
+      throws QueryProcessException;
+
+  /**
+   * Aggregate results cannot be calculated using Statistics directly, using 
the data in each page
+   *
+   * @param dataInThisPage the data in Page
+   */
+  public abstract void updateResultFromPageData(BatchData dataInThisPage) 
throws IOException;
+  /**
+   * Aggregate results cannot be calculated using Statistics directly, using 
the data in each page
+   *
+   * @param dataInThisPage the data in Page
+   * @param bound calculate points whose time < bound
+   */
+  public abstract void updateResultFromPageData(BatchData dataInThisPage, long 
bound)
+      throws IOException;
+
+  /**
+   * <p> This method is calculate the aggregation using the common timestamps 
of cross series
 
 Review comment:
   Fixed. Thx.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to