You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by su...@apache.org on 2019/09/09 02:19:51 UTC
[incubator-iotdb] branch rename_mean_to_avg created (now 73ee31b)
This is an automated email from the ASF dual-hosted git repository.
suyue pushed a change to branch rename_mean_to_avg
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git.
at 73ee31b rename
This branch includes the following new commits:
new 73ee31b rename
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[incubator-iotdb] 01/01: rename
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
suyue pushed a commit to branch rename_mean_to_avg
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
commit 73ee31b802ba59b5328e06c0f8f5805b2fc9faf9
Author: suyue <23...@qq.com>
AuthorDate: Mon Sep 9 10:19:18 2019 +0800
rename
---
.../impl/{MeanAggrFunc.java => AvgAggrFunc.java} | 8 +++----
.../db/query/aggregation/impl/SumAggrFunc.java | 2 +-
.../iotdb/db/query/factory/AggreFuncFactory.java | 6 ++---
.../org/apache/iotdb/db/service/TSServiceImpl.java | 14 +----------
.../org/apache/iotdb/db/integration/Constant.java | 4 ++--
.../iotdb/db/integration/IOTDBGroupByIT.java | 12 +++++-----
.../iotdb/db/integration/IoTDBAggregationIT.java | 23 +++++++++---------
.../integration/IoTDBAggregationLargeDataIT.java | 28 +++++++++++-----------
.../integration/IoTDBAggregationSmallDataIT.java | 12 +++++-----
.../tsfile/common/constant/StatisticConstant.java | 2 +-
10 files changed, 49 insertions(+), 62 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/query/aggregation/impl/MeanAggrFunc.java b/server/src/main/java/org/apache/iotdb/db/query/aggregation/impl/AvgAggrFunc.java
similarity index 96%
rename from server/src/main/java/org/apache/iotdb/db/query/aggregation/impl/MeanAggrFunc.java
rename to server/src/main/java/org/apache/iotdb/db/query/aggregation/impl/AvgAggrFunc.java
index dd506af..cabaf54 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/aggregation/impl/MeanAggrFunc.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/aggregation/impl/AvgAggrFunc.java
@@ -29,14 +29,14 @@ import org.apache.iotdb.tsfile.file.header.PageHeader;
import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
import org.apache.iotdb.tsfile.read.common.BatchData;
-public class MeanAggrFunc extends AggregateFunction {
+public class AvgAggrFunc extends AggregateFunction {
protected double sum = 0.0;
private int cnt = 0;
private TSDataType seriesDataType;
- private static final String MEAN_AGGR_NAME = "MEAN";
+ private static final String AVG_AGGR_NAME = "AVG";
- public MeanAggrFunc(TSDataType seriesDataType) {
+ public AvgAggrFunc(TSDataType seriesDataType) {
super(TSDataType.DOUBLE);
this.seriesDataType = seriesDataType;
}
@@ -167,6 +167,6 @@ public class MeanAggrFunc extends AggregateFunction {
* Return type name of aggregation
*/
public String getAggreTypeName() {
- return MEAN_AGGR_NAME;
+ return AVG_AGGR_NAME;
}
}
diff --git a/server/src/main/java/org/apache/iotdb/db/query/aggregation/impl/SumAggrFunc.java b/server/src/main/java/org/apache/iotdb/db/query/aggregation/impl/SumAggrFunc.java
index e4311e8..b336eb8 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/aggregation/impl/SumAggrFunc.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/aggregation/impl/SumAggrFunc.java
@@ -22,7 +22,7 @@ package org.apache.iotdb.db.query.aggregation.impl;
import org.apache.iotdb.db.query.aggregation.AggreResultData;
import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
-public class SumAggrFunc extends MeanAggrFunc {
+public class SumAggrFunc extends AvgAggrFunc {
private static final String SUM_AGGR_NAME = "SUM";
diff --git a/server/src/main/java/org/apache/iotdb/db/query/factory/AggreFuncFactory.java b/server/src/main/java/org/apache/iotdb/db/query/factory/AggreFuncFactory.java
index 495d853..595d17d 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/factory/AggreFuncFactory.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/factory/AggreFuncFactory.java
@@ -21,12 +21,12 @@ package org.apache.iotdb.db.query.factory;
import org.apache.iotdb.db.exception.ProcessorException;
import org.apache.iotdb.db.query.aggregation.AggregateFunction;
+import org.apache.iotdb.db.query.aggregation.impl.AvgAggrFunc;
import org.apache.iotdb.db.query.aggregation.impl.CountAggrFunc;
import org.apache.iotdb.db.query.aggregation.impl.FirstAggrFunc;
import org.apache.iotdb.db.query.aggregation.impl.LastAggrFunc;
import org.apache.iotdb.db.query.aggregation.impl.MaxTimeAggrFunc;
import org.apache.iotdb.db.query.aggregation.impl.MaxValueAggrFunc;
-import org.apache.iotdb.db.query.aggregation.impl.MeanAggrFunc;
import org.apache.iotdb.db.query.aggregation.impl.MinTimeAggrFunc;
import org.apache.iotdb.db.query.aggregation.impl.MinValueAggrFunc;
import org.apache.iotdb.db.query.aggregation.impl.SumAggrFunc;
@@ -64,8 +64,8 @@ public class AggreFuncFactory {
return new MaxValueAggrFunc(dataType);
case StatisticConstant.COUNT:
return new CountAggrFunc();
- case StatisticConstant.MEAN:
- return new MeanAggrFunc(dataType);
+ case StatisticConstant.AVG:
+ return new AvgAggrFunc(dataType);
case StatisticConstant.FIRST:
return new FirstAggrFunc(dataType);
case StatisticConstant.SUM:
diff --git a/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java b/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
index ae6496b..3ca62fb 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
@@ -75,18 +75,6 @@ import org.apache.thrift.server.ServerContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.time.ZoneId;
-import java.util.*;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.regex.Pattern;
-
-import static org.apache.iotdb.db.conf.IoTDBConstant.*;
-
/**
* Thrift RPC implementation at server side.
*/
@@ -382,7 +370,7 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
case StatisticConstant.MIN_VALUE:
case StatisticConstant.MAX_VALUE:
return getSeriesType(innerPath);
- case StatisticConstant.MEAN:
+ case StatisticConstant.AVG:
case StatisticConstant.SUM:
return TSDataType.DOUBLE;
default:
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/Constant.java b/server/src/test/java/org/apache/iotdb/db/integration/Constant.java
index 256b8f2..09639fc 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/Constant.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/Constant.java
@@ -63,8 +63,8 @@ public class Constant {
return String.format("sum(%s)", path);
}
- public static String mean(String path) {
- return String.format("mean(%s)", path);
+ public static String avg(String path) {
+ return String.format("avg(%s)", path);
}
public static String count(String path) {
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IOTDBGroupByIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IOTDBGroupByIT.java
index a279992..3c73fe1 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IOTDBGroupByIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IOTDBGroupByIT.java
@@ -19,12 +19,12 @@
package org.apache.iotdb.db.integration;
+import static org.apache.iotdb.db.integration.Constant.avg;
import static org.apache.iotdb.db.integration.Constant.count;
import static org.apache.iotdb.db.integration.Constant.first;
import static org.apache.iotdb.db.integration.Constant.last;
import static org.apache.iotdb.db.integration.Constant.max_time;
import static org.apache.iotdb.db.integration.Constant.max_value;
-import static org.apache.iotdb.db.integration.Constant.mean;
import static org.apache.iotdb.db.integration.Constant.min_time;
import static org.apache.iotdb.db.integration.Constant.min_value;
import static org.apache.iotdb.db.integration.Constant.sum;
@@ -127,7 +127,7 @@ public class IOTDBGroupByIT {
}
@Test
- public void countSumMeanTest() throws SQLException {
+ public void countSumavgTest() throws SQLException {
String[] retArray1 = new String[]{
"2,1,4.4,4.4",
"5,3,35.8,11.933333333333332",
@@ -156,7 +156,7 @@ public class IOTDBGroupByIT {
getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
boolean hasResultSet = statement.execute(
- "select count(temperature), sum(temperature), mean(temperature) from "
+ "select count(temperature), sum(temperature), avg(temperature) from "
+ "root.ln.wf01.wt01 where time > 3 "
+ "GROUP BY (20ms, 5,[2,30], [35,37], [50, 160], [310, 314])");
@@ -168,7 +168,7 @@ public class IOTDBGroupByIT {
String ans = resultSet.getString(TIMESTAMP_STR) + "," + resultSet
.getString(count("root.ln.wf01.wt01.temperature")) + "," +
resultSet.getString(sum("root.ln.wf01.wt01.temperature")) + "," + resultSet
- .getString(mean("root.ln.wf01.wt01.temperature"));
+ .getString(avg("root.ln.wf01.wt01.temperature"));
Assert.assertEquals(retArray1[cnt], ans);
cnt++;
}
@@ -176,7 +176,7 @@ public class IOTDBGroupByIT {
}
hasResultSet = statement.execute(
- "select count(temperature), sum(temperature), mean(temperature) from "
+ "select count(temperature), sum(temperature), avg(temperature) from "
+ "root.ln.wf01.wt01 where temperature > 3 "
+ "GROUP BY (20ms, 5,[2,30], [35,37], [50, 160], [310, 314])");
@@ -187,7 +187,7 @@ public class IOTDBGroupByIT {
String ans = resultSet.getString(TIMESTAMP_STR) + "," + resultSet
.getString(count("root.ln.wf01.wt01.temperature")) + "," +
resultSet.getString(sum("root.ln.wf01.wt01.temperature")) + "," + resultSet
- .getString(mean("root.ln.wf01.wt01.temperature"));
+ .getString(avg("root.ln.wf01.wt01.temperature"));
Assert.assertEquals(retArray2[cnt], ans);
cnt++;
}
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBAggregationIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBAggregationIT.java
index ab613f3..86e9e57 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBAggregationIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBAggregationIT.java
@@ -19,12 +19,12 @@
package org.apache.iotdb.db.integration;
+import static org.apache.iotdb.db.integration.Constant.avg;
import static org.apache.iotdb.db.integration.Constant.count;
import static org.apache.iotdb.db.integration.Constant.first;
import static org.apache.iotdb.db.integration.Constant.last;
import static org.apache.iotdb.db.integration.Constant.max_time;
import static org.apache.iotdb.db.integration.Constant.max_value;
-import static org.apache.iotdb.db.integration.Constant.mean;
import static org.apache.iotdb.db.integration.Constant.min_time;
import static org.apache.iotdb.db.integration.Constant.min_value;
import static org.apache.iotdb.db.integration.Constant.sum;
@@ -36,7 +36,6 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Locale;
-
import org.apache.iotdb.db.service.IoTDB;
import org.apache.iotdb.db.utils.EnvironmentUtils;
import org.apache.iotdb.jdbc.Config;
@@ -415,7 +414,7 @@ public class IoTDBAggregationIT {
}
@Test
- public void meanSumTest() {
+ public void avgSumTest() {
String[] retArray = new String[]{
"0,1.4508E7,7250.374812593703",
"0,626750.0,1250.998003992016"
@@ -424,7 +423,7 @@ public class IoTDBAggregationIT {
getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
- boolean hasResultSet = statement.execute("select sum(s0),mean(s2)" +
+ boolean hasResultSet = statement.execute("select sum(s0),avg(s2)" +
"from root.vehicle.d0 where time >= 6000 and time <= 9000");
Assert.assertTrue(hasResultSet);
@@ -432,21 +431,21 @@ public class IoTDBAggregationIT {
try (ResultSet resultSet = statement.getResultSet()) {
while (resultSet.next()) {
String ans = resultSet.getString(TIMESTAMP_STR) + "," + resultSet.getString(sum(d0s0))
- + "," + resultSet.getString(mean(d0s2));
+ + "," + resultSet.getString(avg(d0s2));
Assert.assertEquals(retArray[cnt], ans);
cnt++;
}
Assert.assertEquals(1, cnt);
}
- hasResultSet = statement.execute("select sum(s0),mean(s2)" +
+ hasResultSet = statement.execute("select sum(s0),avg(s2)" +
"from root.vehicle.d0 where time >= 1000 and time <= 2000");
Assert.assertTrue(hasResultSet);
try (ResultSet resultSet = statement.getResultSet()) {
while (resultSet.next()) {
String ans = resultSet.getString(TIMESTAMP_STR) + "," + resultSet.getString(sum(d0s0))
- + "," + resultSet.getString(mean(d0s2));
+ + "," + resultSet.getString(avg(d0s2));
Assert.assertEquals(retArray[cnt], ans);
cnt++;
}
@@ -459,19 +458,19 @@ public class IoTDBAggregationIT {
}
@Test
- public void meanSumErrorTest() throws SQLException {
+ public void avgSumErrorTest() throws SQLException {
try (Connection connection = DriverManager.
getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
- boolean hasResultSet = statement.execute("select mean(s3)" +
+ boolean hasResultSet = statement.execute("select avg(s3)" +
"from root.vehicle.d0 where time >= 6000 and time <= 9000");
Assert.assertTrue(hasResultSet);
try (ResultSet resultSet = statement.getResultSet()) {
resultSet.next();
fail();
} catch (Exception e) {
- Assert.assertEquals("Internal server error: Unsupported data type in aggregation MEAN : TEXT", e.getMessage());
+ Assert.assertEquals("Internal server error: Unsupported data type in aggregation AVG : TEXT", e.getMessage());
}
hasResultSet = statement.execute("select sum(s3)" +
@@ -484,7 +483,7 @@ public class IoTDBAggregationIT {
Assert.assertEquals("Internal server error: Unsupported data type in aggregation SUM : TEXT", e.getMessage());
}
- hasResultSet = statement.execute("select mean(s4)" +
+ hasResultSet = statement.execute("select avg(s4)" +
"from root.vehicle.d0 where time >= 6000 and time <= 9000");
Assert.assertTrue(hasResultSet);
@@ -492,7 +491,7 @@ public class IoTDBAggregationIT {
resultSet.next();
fail();
} catch (Exception e) {
- Assert.assertEquals("Internal server error: Unsupported data type in aggregation MEAN : BOOLEAN", e.getMessage());
+ Assert.assertEquals("Internal server error: Unsupported data type in aggregation AVG : BOOLEAN", e.getMessage());
}
hasResultSet = statement.execute("select sum(s4)" +
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBAggregationLargeDataIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBAggregationLargeDataIT.java
index 7de74bc..fdb43b1 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBAggregationLargeDataIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBAggregationLargeDataIT.java
@@ -19,11 +19,11 @@
package org.apache.iotdb.db.integration;
+import static org.apache.iotdb.db.integration.Constant.avg;
import static org.apache.iotdb.db.integration.Constant.count;
import static org.apache.iotdb.db.integration.Constant.first;
import static org.apache.iotdb.db.integration.Constant.max_time;
import static org.apache.iotdb.db.integration.Constant.max_value;
-import static org.apache.iotdb.db.integration.Constant.mean;
import static org.apache.iotdb.db.integration.Constant.min_value;
import static org.apache.iotdb.db.integration.Constant.sum;
import static org.junit.Assert.fail;
@@ -132,7 +132,7 @@ public class IoTDBAggregationLargeDataIT {
try (Connection connection = DriverManager.
getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root");) {
lastAggreWithSingleFilterTest();
- meanAggreWithSingleFilterTest();
+ avgAggreWithSingleFilterTest();
sumAggreWithSingleFilterTest();
firstAggreWithSingleFilterTest();
countAggreWithSingleFilterTest();
@@ -146,7 +146,7 @@ public class IoTDBAggregationLargeDataIT {
maxTimeAggreWithMultiFilterTest();
minValueAggreWithMultiFilterTest();
maxValueAggreWithMultiFilterTest();
- meanAggreWithMultiFilterTest();
+ avgAggreWithMultiFilterTest();
sumAggreWithMultiFilterTest();
firstAggreWithMultiFilterTest();
}
@@ -275,7 +275,7 @@ Statement statement = connection.createStatement()) {
}
}
- private void meanAggreWithSingleFilterTest() {
+ private void avgAggreWithSingleFilterTest() {
String[] retArray = new String[]{
"0,75,212,28"
};
@@ -284,15 +284,15 @@ Statement statement = connection.createStatement()) {
Statement statement = connection.createStatement();) {
boolean hasResultSet = statement.execute(
- "select mean(s0),mean(s1),mean(s2) from root.vehicle.d0 where s1 >= 0");
+ "select avg(s0),avg(s1),avg(s2) from root.vehicle.d0 where s1 >= 0");
Assert.assertTrue(hasResultSet);
try (ResultSet resultSet = statement.getResultSet()) {
int cnt = 0;
while (resultSet.next()) {
String ans =
- resultSet.getString(TIMESTAMP_STR) + "," + Math.round(resultSet.getDouble(mean(d0s0)))
- + "," + Math.round(resultSet.getDouble(mean(d0s1))) + "," +
- Math.round(resultSet.getDouble(mean(d0s2)));
+ resultSet.getString(TIMESTAMP_STR) + "," + Math.round(resultSet.getDouble(avg(d0s0)))
+ + "," + Math.round(resultSet.getDouble(avg(d0s1))) + "," +
+ Math.round(resultSet.getDouble(avg(d0s2)));
//System.out.println("!!!!!============ " + ans);
Assert.assertEquals(retArray[cnt], ans);
cnt++;
@@ -457,7 +457,7 @@ Statement statement = connection.createStatement()) {
}
}
- private void meanAggreWithMultiFilterTest() throws ClassNotFoundException, SQLException {
+ private void avgAggreWithMultiFilterTest() throws ClassNotFoundException, SQLException {
String[] retArray = new String[]{
"0,55061.0,733,75,212,28"
};
@@ -467,8 +467,8 @@ Statement statement = connection.createStatement()) {
getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
- boolean hasResultSet = statement.execute("select sum(s0),count(s0),mean(s0),mean(s1),"
- + "mean(s2) from root.vehicle.d0 " +
+ boolean hasResultSet = statement.execute("select sum(s0),count(s0),avg(s0),avg(s1),"
+ + "avg(s2) from root.vehicle.d0 " +
"where s1 >= 0 or s2 < 10");
Assert.assertTrue(hasResultSet);
ResultSet resultSet = statement.getResultSet();
@@ -476,10 +476,10 @@ Statement statement = connection.createStatement()) {
while (resultSet.next()) {
String ans =
resultSet.getString(TIMESTAMP_STR) + "," + resultSet.getString(sum(d0s0)) + "," +
- resultSet.getString(count(d0s0)) + "," + Math.round(resultSet.getDouble(mean(d0s0)))
+ resultSet.getString(count(d0s0)) + "," + Math.round(resultSet.getDouble(avg(d0s0)))
+ "," +
- Math.round(resultSet.getDouble(mean(d0s1))) + "," + Math
- .round(resultSet.getDouble(mean(d0s2)));
+ Math.round(resultSet.getDouble(avg(d0s1))) + "," + Math
+ .round(resultSet.getDouble(avg(d0s2)));
//System.out.println("!!!!!============ " + ans);
Assert.assertEquals(retArray[cnt], ans);
cnt++;
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBAggregationSmallDataIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBAggregationSmallDataIT.java
index de41848..6942330 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBAggregationSmallDataIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBAggregationSmallDataIT.java
@@ -19,12 +19,12 @@
package org.apache.iotdb.db.integration;
+import static org.apache.iotdb.db.integration.Constant.avg;
import static org.apache.iotdb.db.integration.Constant.count;
import static org.apache.iotdb.db.integration.Constant.first;
import static org.apache.iotdb.db.integration.Constant.last;
import static org.apache.iotdb.db.integration.Constant.max_time;
import static org.apache.iotdb.db.integration.Constant.max_value;
-import static org.apache.iotdb.db.integration.Constant.mean;
import static org.apache.iotdb.db.integration.Constant.min_time;
import static org.apache.iotdb.db.integration.Constant.min_value;
import static org.apache.iotdb.db.integration.Constant.sum;
@@ -358,7 +358,7 @@ public class IoTDBAggregationSmallDataIT {
}
@Test
- public void meanAggreWithSingleFilterTest() throws ClassNotFoundException, SQLException {
+ public void avgAggreWithSingleFilterTest() throws ClassNotFoundException, SQLException {
String[] retArray = new String[]{
"0,11160.5,18645,206"
};
@@ -367,14 +367,14 @@ public class IoTDBAggregationSmallDataIT {
getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
boolean hasResultSet = statement.execute(
- "select mean(s0),mean(s1),mean(s2) from root.vehicle.d0 where s2 >= 3.33");
+ "select avg(s0),avg(s1),avg(s2) from root.vehicle.d0 where s2 >= 3.33");
Assert.assertTrue(hasResultSet);
try (ResultSet resultSet = statement.getResultSet()) {
int cnt = 0;
while (resultSet.next()) {
- String ans = resultSet.getString(TIMESTAMP_STR) + "," + resultSet.getString(mean(d0s0))
- + "," + Math.round(resultSet.getDouble(mean(d0s1))) + ","
- + Math.round(resultSet.getDouble(mean(d0s2)));
+ String ans = resultSet.getString(TIMESTAMP_STR) + "," + resultSet.getString(avg(d0s0))
+ + "," + Math.round(resultSet.getDouble(avg(d0s1))) + ","
+ + Math.round(resultSet.getDouble(avg(d0s2)));
//System.out.println("!!!!!============ " + ans);
Assert.assertEquals(retArray[cnt], ans);
cnt++;
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/common/constant/StatisticConstant.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/common/constant/StatisticConstant.java
index 67215ff..a65567e 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/common/constant/StatisticConstant.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/common/constant/StatisticConstant.java
@@ -31,7 +31,7 @@ public class StatisticConstant {
public static final String FIRST = "first";
- public static final String MEAN = "mean";
+ public static final String AVG = "avg";
public static final String SUM = "sum";