qiaojialin commented on a change in pull request #1060:
URL: https://github.com/apache/incubator-iotdb/pull/1060#discussion_r414950035



##########
File path: 
example/hadoop/src/main/java/org/apache/iotdb/hadoop/tsfile/TsFileHelper.java
##########
@@ -52,39 +54,47 @@ public static void writeTsFile(String filePath) {
 
       Schema schema = new Schema();
 
+      List<MeasurementSchema> schemaList = new ArrayList<>();
+
       // the number of rows to include in the row batch
       int rowNum = 1000000;
       // the number of values to include in the row batch
       int sensorNum = 10;
 
       // add measurements into file schema (all with INT64 data type)
       for (int i = 0; i < 2; i++) {
+        MeasurementSchema measurementSchema = new MeasurementSchema(
+            Constant.SENSOR_PREFIX + (i + 1), TSDataType.INT64,
+            TSEncoding.TS_2DIFF);
         schema.registerTimeseries(new Path(Constant.DEVICE_1, 
Constant.SENSOR_PREFIX + (i + 1)),
-            new MeasurementSchema(Constant.SENSOR_PREFIX + (i + 1), 
TSDataType.INT64,
-                TSEncoding.TS_2DIFF));
+            measurementSchema);
+        schemaList.add(measurementSchema);
       }
 
       for (int i = 2; i < sensorNum; i++) {
+        MeasurementSchema measurementSchema = new MeasurementSchema(
+            Constant.SENSOR_PREFIX + (i + 1), TSDataType.DOUBLE,
+            TSEncoding.TS_2DIFF);
         schema.registerTimeseries(new Path(Constant.DEVICE_1, 
Constant.SENSOR_PREFIX + (i + 1)),
-            new MeasurementSchema(Constant.SENSOR_PREFIX + (i + 1), 
TSDataType.DOUBLE,
-                TSEncoding.TS_2DIFF));
+            measurementSchema);
+        schemaList.add(measurementSchema);
       }
 
       // add measurements into TSFileWriter
       TsFileWriter tsFileWriter = new TsFileWriter(file, schema);
 
       // construct the row batch
-      RowBatch rowBatch = schema.createRowBatch(Constant.DEVICE_1);
+      Tablet tablet = new Tablet(Constant.DEVICE_1, schemaList);

Review comment:
       fixed




----------------------------------------------------------------
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:
[email protected]


Reply via email to