Zesong Sun created IOTDB-1378:
---------------------------------

             Summary: MetadataIndexTree constructs error when existing more 
than one chunks in vector
                 Key: IOTDB-1378
                 URL: https://issues.apache.org/jira/browse/IOTDB-1378
             Project: Apache IoTDB
          Issue Type: Bug
          Components: Core/TsFile
            Reporter: Zesong Sun
            Assignee: Zesong Sun
             Fix For: 0.13.0


MetadataIndexTree constructs error when existing more than one chunks in vector.

insert with aligned timeseries:

 {code}
private static void insertTabletWithAlignedTimeseriesMethod1()
      throws IoTDBConnectionException, StatementExecutionException {
    // The schema of measurements of one device
    // only measurementId and data type in MeasurementSchema take effects in 
Tablet
    List<IMeasurementSchema> schemaList = new ArrayList<>();
    schemaList.add(
        new VectorMeasurementSchema(
            new String[] {"s1", "s2"}, new TSDataType[] {TSDataType.INT64, 
TSDataType.INT32}));

    Tablet tablet = new Tablet(ROOT_SG1_D1, schemaList, 1);
    long timestamp = System.currentTimeMillis();

    for (long row = 0; row < 5; row++) {
      int rowIndex = tablet.rowSize++;
      tablet.addTimestamp(rowIndex, timestamp);
      tablet.addValue(
          schemaList.get(0).getValueMeasurementIdList().get(0),
          rowIndex,
          new SecureRandom().nextLong());
      tablet.addValue(
          schemaList.get(0).getValueMeasurementIdList().get(1),
          rowIndex,
          new SecureRandom().nextInt());

      if (tablet.rowSize == tablet.getMaxRowNumber()) {
        session.insertTablet(tablet, true);
        tablet.reset();
      }
      timestamp++;
    }

    if (tablet.rowSize != 0) {
      session.insertTablet(tablet);
      tablet.reset();
    }

    session.executeNonQueryStatement("flush");
  }
{code}

query:
{code}
SessionDataSet dataSet = session.executeQueryStatement("select * from 
root.sg_1.d1");
    System.out.println(dataSet.getColumnNames());
    while (dataSet.hasNext()) {
      System.out.println(dataSet.next());
    }
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to