qiaojialin commented on a change in pull request #2992:
URL: https://github.com/apache/iotdb/pull/2992#discussion_r611273841
##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -1541,7 +1541,7 @@ protected void sortTablet(Tablet tablet) {
int measurementSize = schema.getValueMeasurementIdList().size();
for (int j = 0; j < measurementSize; j++) {
tablet.values[columnIndex] =
- sortList(tablet.values[columnIndex],
schema.getValueTSDataTypeList().get(i), index);
+ sortList(tablet.values[columnIndex],
schema.getValueTSDataTypeList().get(j), index);
Review comment:
add a test
##########
File path:
example/session/src/main/java/org/apache/iotdb/VectorSessionExample.java
##########
@@ -215,18 +215,42 @@ private static void insertTabletWithAlignedTimeseries()
Tablet tablet = new Tablet(ROOT_SG1_D1, schemaList);
+ // Method 1 to add tablet data
+ long timestamp = System.currentTimeMillis();
+
+ for (long row = 0; row < 100; row++) {
+ int rowIndex = tablet.rowSize++;
+ tablet.addTimestamp(rowIndex, timestamp);
+ tablet.addValue(
+ schemaList.get(0).getValueMeasurementIdList().get(0), rowIndex, new
Random().nextLong());
+ tablet.addValue(
+ schemaList.get(0).getValueMeasurementIdList().get(1), rowIndex, new
Random().nextInt());
+
+ if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ session.insertTablet(tablet, true);
+ tablet.reset();
+ }
+ timestamp++;
+ }
+
+ if (tablet.rowSize != 0) {
+ session.insertTablet(tablet);
+ tablet.reset();
+ }
+
+ // Method 2 to add tablet data
Review comment:
How about splitting these two methods into two functions, in case of
users insert duplicated data.
--
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]