This is an automated email from the ASF dual-hosted git repository.

haonan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new efa14ec  [IOTDB-2607] Fix session example error (#5119)
efa14ec is described below

commit efa14ecf97c7b9fec523088fd7db58e7999ac961
Author: Zhang Zeyu <[email protected]>
AuthorDate: Fri Feb 25 14:28:35 2022 +0800

    [IOTDB-2607] Fix session example error (#5119)
    
    Co-authored-by: Zhang Zeyu <[email protected]>
    Co-authored-by: Haonan <[email protected]>
---
 .../org/apache/iotdb/AlignedTimeseriesSessionExample.java  | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git 
a/example/session/src/main/java/org/apache/iotdb/AlignedTimeseriesSessionExample.java
 
b/example/session/src/main/java/org/apache/iotdb/AlignedTimeseriesSessionExample.java
index aa98341..aa734bc 100644
--- 
a/example/session/src/main/java/org/apache/iotdb/AlignedTimeseriesSessionExample.java
+++ 
b/example/session/src/main/java/org/apache/iotdb/AlignedTimeseriesSessionExample.java
@@ -546,12 +546,12 @@ public class AlignedTimeseriesSessionExample {
     schemaList1.add(new MeasurementSchema("s2", TSDataType.INT64));
 
     List<MeasurementSchema> schemaList2 = new ArrayList<>();
-    schemaList1.add(new MeasurementSchema("s1", TSDataType.INT64));
-    schemaList1.add(new MeasurementSchema("s2", TSDataType.INT64));
+    schemaList2.add(new MeasurementSchema("s1", TSDataType.INT64));
+    schemaList2.add(new MeasurementSchema("s2", TSDataType.INT64));
 
     List<MeasurementSchema> schemaList3 = new ArrayList<>();
-    schemaList1.add(new MeasurementSchema("s1", TSDataType.INT64));
-    schemaList1.add(new MeasurementSchema("s2", TSDataType.INT64));
+    schemaList3.add(new MeasurementSchema("s1", TSDataType.INT64));
+    schemaList3.add(new MeasurementSchema("s2", TSDataType.INT64));
 
     Tablet tablet1 = new Tablet(ROOT_SG2_D1_VECTOR6, schemaList1, 100);
     Tablet tablet2 = new Tablet(ROOT_SG2_D1_VECTOR7, schemaList2, 100);
@@ -573,9 +573,9 @@ public class AlignedTimeseriesSessionExample {
       tablet3.addTimestamp(row3, timestamp);
       for (int i = 0; i < 2; i++) {
         long value = new SecureRandom().nextLong();
-        tablet1.addValue(schemaList1.get(0).getSubMeasurementsList().get(i), 
row1, value);
-        tablet2.addValue(schemaList2.get(0).getSubMeasurementsList().get(i), 
row2, value);
-        tablet3.addValue(schemaList3.get(0).getSubMeasurementsList().get(i), 
row3, value);
+        tablet1.addValue(schemaList1.get(i).getMeasurementId(), row1, value);
+        tablet2.addValue(schemaList2.get(i).getMeasurementId(), row2, value);
+        tablet3.addValue(schemaList3.get(i).getMeasurementId(), row3, value);
       }
       if (tablet1.rowSize == tablet1.getMaxRowNumber()) {
         session.insertAlignedTablets(tabletMap, true);

Reply via email to