Skip to content

Commit

Permalink
Fix okPointNum statistics for table models.
Browse files Browse the repository at this point in the history
  • Loading branch information
YangYumings committed Nov 28, 2024
1 parent bb4035a commit 963ab57
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import cn.edu.tsinghua.iot.benchmark.entity.DeviceSummary;
import cn.edu.tsinghua.iot.benchmark.entity.Record;
import cn.edu.tsinghua.iot.benchmark.entity.Sensor;
import cn.edu.tsinghua.iot.benchmark.entity.enums.SQLDialect;
import cn.edu.tsinghua.iot.benchmark.entity.enums.SensorType;
import cn.edu.tsinghua.iot.benchmark.exception.OperationFailException;
import cn.edu.tsinghua.iot.benchmark.iotdb200.IoTDB;
Expand Down Expand Up @@ -366,7 +367,11 @@ public long executeQueryAndGetStatusImpl(
long resultPointNum = line.get();
if (!Operation.LATEST_POINT_QUERY.equals(operation)) {
resultPointNum *= config.getQUERY_SENSOR_NUM();
resultPointNum *= config.getQUERY_DEVICE_NUM();
if (!config.getIoTDB_DIALECT_MODE().equals(SQLDialect.TABLE)) {
resultPointNum *= config.getQUERY_DEVICE_NUM();
}
} else if (config.getIoTDB_DIALECT_MODE().equals(SQLDialect.TABLE)) {
resultPointNum *= config.getQUERY_SENSOR_NUM();
}
queryResultPointNum.set(resultPointNum);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public String getGroupByQuerySQL(GroupByQuery groupByQuery, boolean addOrderBy)
builder
.append("SELECT")
.append(" device_id,")
.append(" date_bin(")
.append(" date_bin_gapfill(")
.append(groupByQuery.getGranularity())
.append("ms, ")
.append("time), ")
Expand All @@ -225,7 +225,7 @@ public String getGroupByQuerySQL(GroupByQuery groupByQuery, boolean addOrderBy)
addDeviceIDColumnIfNecessary(groupByQuery.getDeviceSchema(), builder);
// GROUP BY
builder
.append(" group by device_id, date_bin(")
.append(" group by device_id, date_bin_gapfill(")
.append(groupByQuery.getGranularity())
.append("ms, time)");
// ORDER BY
Expand Down

0 comments on commit 963ab57

Please sign in to comment.