Skip to content

Commit

Permalink
copy schema in Tablet constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
shuwenwei committed Nov 19, 2024
1 parent 1ddbefa commit 6aa8d1e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public Tablet(String deviceId, List<IMeasurementSchema> schemas) {

public Tablet(String deviceId, List<IMeasurementSchema> schemas, int maxRowNumber) {
this.insertTargetName = deviceId;
this.schemas = schemas;
this.schemas = new ArrayList<>(schemas);
setColumnCategories(ColumnCategory.nCopy(ColumnCategory.MEASUREMENT, schemas.size()));
this.maxRowNumber = maxRowNumber;
measurementIndex = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public void testUsingDefaultSchemaTemplate() throws IOException, WriteProcessExc
schema.put("s2", s2);

writer.registerSchemaTemplate("defaultTemplate", schema, false);
writer.registerDevice("d1", "defaultTemplate");

Tablet tablet = new Tablet("d1", schemaList);
long[] timestamps = tablet.timestamps;
Expand Down

0 comments on commit 6aa8d1e

Please sign in to comment.