@Test
  public void testCompactionWithMinTimestamp() throws IOException {
    TsFileResource seqResource1 = createEmptyFileAndResource(true);
    try (CompactionTestFileWriter writer = new CompactionTestFileWriter(seqResource1)) {
      writer.startChunkGroup("d2");
      writer.generateSimpleNonAlignedSeriesToCurrentDevice(
          "s1",
          new TimeRange[] {new TimeRange(Long.MIN_VALUE, Long.MIN_VALUE)},
          TSEncoding.PLAIN,
          CompressionType.LZ4);
      writer.endChunkGroup();
      writer.endFile();
    }
    TsFileResource seqResource2 = createEmptyFileAndResource(true);
    try (CompactionTestFileWriter writer = new CompactionTestFileWriter(seqResource2)) {
      writer.startChunkGroup("d1");
      writer.generateSimpleAlignedSeriesToCurrentDevice(
          Arrays.asList("s1", "s2"),
          new TimeRange[] {new TimeRange(Long.MIN_VALUE, Long.MIN_VALUE)},
          TSEncoding.PLAIN,
          CompressionType.LZ4);
      writer.endChunkGroup();
      writer.endFile();
    }
    TsFileResource unseqResource1 = createEmptyFileAndResource(true);
    try (CompactionTestFileWriter writer = new CompactionTestFileWriter(unseqResource1)) {
      writer.startChunkGroup("d1");
      writer.generateSimpleAlignedSeriesToCurrentDevice(
          Arrays.asList("s1", "s2"),
          new TimeRange[] {new TimeRange(Long.MIN_VALUE, Long.MIN_VALUE)},
          TSEncoding.PLAIN,
          CompressionType.LZ4);
      writer.endChunkGroup();
      writer.startChunkGroup("d2");
      writer.generateSimpleNonAlignedSeriesToCurrentDevice(
          "s1",
          new TimeRange[] {new TimeRange(Long.MIN_VALUE, Long.MIN_VALUE)},
          TSEncoding.PLAIN,
          CompressionType.LZ4);
      writer.endChunkGroup();
      writer.endFile();
    }
    seqResources.add(seqResource1);
    seqResources.add(seqResource2);
    unseqResources.add(unseqResource1);
    CrossSpaceCompactionTask task =
        new CrossSpaceCompactionTask(
            0,
            tsFileManager,
            seqResources,
            unseqResources,
            new FastCompactionPerformer(true),
            1000,
            0);
    Assert.assertTrue(task.start());
    TsFileResource target1 = tsFileManager.getTsFileList(true).get(0);
    TsFileResource target2 = tsFileManager.getTsFileList(true).get(1);
    Assert.assertEquals(1, target1.getDevices().size());
    Assert.assertEquals(1, target2.getDevices().size());
    Assert.assertEquals(
        Long.MIN_VALUE,
        target1
            .getStartTime(IDeviceID.Factory.DEFAULT_FACTORY.create("root.testsg.d2"))
            .get()
            .longValue());
    Assert.assertEquals(
        Long.MIN_VALUE,
        target2
            .getStartTime(IDeviceID.Factory.DEFAULT_FACTORY.create("root.testsg.d1"))
            .get()
            .longValue());
  }
Total 4 seq files and 5 unseq files, each file has different nonAligned timeseries.

<p>Seq files<br>
first and second file has d0 ~ d1 and s0 ~ s2, time range is 0 ~ 299 and 350 ~ 649, value range
is 0 ~ 299 and 350 ~ 649.<br>
third and forth file has d0 ~ d3 and s0 ~ S4,time range is 700 ~ 999 and 1050 ~ 1349, value
range is 700 ~ 999 and 1050 ~ 1349.<br>

<p>UnSeq files<br>
first, second and third file has d0 ~ d2 and s0 ~ s3, time range is 20 ~ 219, 250 ~ 449 and 480
~ 679, value range is 10020 ~ 10219, 10250 ~ 10449 and 10480 ~ 10679.<br>
forth and fifth file has d0 and s0 ~ s4, time range is 450 ~ 549 and 550 ~ 649, value range is
20450 ~ 20549 and 20550 ~ 20649.
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/FastCrossCompactionPerformerTest.java