private static void insertAlignedRecord()
      throws IoTDBConnectionException, StatementExecutionException {
    // first file we have both sensots' data
    List<String> measurements = new ArrayList<>();
    List<TSDataType> types = new ArrayList<>();
    measurements.add("s1");
    measurements.add("s2");
    types.add(TSDataType.INT64);
    types.add(TSDataType.INT32);

    for (long time = 0; time < 10; time++) {
      List<Object> values = new ArrayList<>();
      values.add(time);
      values.add((int) time);
      session.insertAlignedRecord(ROOT_SG1_D1, time, measurements, types, values);
    }
    session.executeNonQueryStatement(FLUSH);
    // second file we only have s1's data
    measurements.clear();
    types.clear();
    measurements.add("s1");
    types.add(TSDataType.INT64);
    for (long time = 10; time < 20; time++) {
      List<Object> values = new ArrayList<>();
      values.add(time);
      session.insertAlignedRecord(ROOT_SG1_D1, time, measurements, types, values);
    }
  }
Method 2 for insert tablet with aligned timeseries
example/session/src/main/java/org/apache/iotdb/AlignedTimeseriesSessionExample.java