Skip to content

Commit

Permalink
Renamed ID->TAG, MEASUREMENT->FIELD in create/desc table sql
Browse files Browse the repository at this point in the history
  • Loading branch information
JackieTien97 authored Dec 27, 2024
2 parents 9e72639 + 7d9091a commit c2e8e1a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public long pointNum() {
// Count the number of measurements
List<Sensor> sensors = deviceSchema.getSensors();
for (Sensor sensor : sensors) {
if (sensor.getColumnCategory() == ColumnCategory.MEASUREMENT) {
if (sensor.getColumnCategory() == ColumnCategory.FIELD) {
measureNum++;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public long pointNum() {
long measureNum = 0;
List<Sensor> sensors = deviceSchemas.get(0).getSensors();
for (Sensor sensor : sensors) {
if (sensor.getColumnCategory() == ColumnCategory.MEASUREMENT) {
if (sensor.getColumnCategory() == ColumnCategory.FIELD) {
measureNum++;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public Sensor() {}
public Sensor(String name, SensorType sensorType) {
this.name = name;
this.sensorType = sensorType;
this.columnCategory = ColumnCategory.MEASUREMENT;
this.columnCategory = ColumnCategory.FIELD;
}

public Sensor(String name, SensorType sensorType, ColumnCategory columnCategory) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
package cn.edu.tsinghua.iot.benchmark.entity.enums;

public enum ColumnCategory {
ID("ID"),
TAG("TAG"),
ATTRIBUTE("ATTRIBUTE"),
MEASUREMENT("MEASUREMENT");
FIELD("FIELD");

public String name;

Expand All @@ -37,6 +37,6 @@ public static ColumnCategory getType(int ordinal) {
}
}
// default type
return ColumnCategory.MEASUREMENT;
return ColumnCategory.FIELD;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import cn.edu.tsinghua.iot.benchmark.entity.Batch.IBatch;
import cn.edu.tsinghua.iot.benchmark.entity.Record;
import cn.edu.tsinghua.iot.benchmark.entity.Sensor;
import cn.edu.tsinghua.iot.benchmark.entity.enums.ColumnCategory;
import cn.edu.tsinghua.iot.benchmark.entity.enums.SensorType;
import cn.edu.tsinghua.iot.benchmark.iotdb200.DMLStrategy.SessionManager;
import cn.edu.tsinghua.iot.benchmark.iotdb200.IoTDB;
Expand Down Expand Up @@ -118,15 +119,15 @@ private void registerTable(SessionManager metaSession, List<TimeseriesSchema> ti
.append(" ")
.append(SensorType.STRING)
.append(" ")
.append(Tablet.ColumnCategory.ID);
.append(ColumnCategory.TAG);
for (String key : deviceSchema.getTags().keySet()) {
builder
.append(", ")
.append(key)
.append(" ")
.append(SensorType.STRING)
.append(" ")
.append(Tablet.ColumnCategory.ID);
.append(ColumnCategory.TAG);
}
builder.append(")");
tables
Expand Down

0 comments on commit c2e8e1a

Please sign in to comment.