jt2594838 commented on code in PR #13168:
URL: https://github.com/apache/iotdb/pull/13168#discussion_r1716463411


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/container/scan/TsFileInsertionScanDataContainer.java:
##########
@@ -332,35 +331,54 @@ private void moveToNextChunkReader() throws IOException, 
IllegalStateException {
           return;
         case MetaMarker.VALUE_CHUNK_HEADER:
         case MetaMarker.ONLY_ONE_PAGE_VALUE_CHUNK_HEADER:
-          chunkHeader = tsFileSequenceReader.readChunkHeader(marker);
+          if (Objects.isNull(firstChunkHeader4NextSequentialValueChunks)) {
+            chunkHeader = tsFileSequenceReader.readChunkHeader(marker);
 
-          if (Objects.isNull(currentDevice)
-              || !pattern.matchesMeasurement(currentDevice, 
chunkHeader.getMeasurementID())) {
-            tsFileSequenceReader.position(
-                tsFileSequenceReader.position() + chunkHeader.getDataSize());
-            break;
-          }
+            // Do not record empty chunks
+            if (chunkHeader.getDataSize() == 0) {
+              break;
+            }
 
-          // Do not record empty chunk
-          if (chunkHeader.getDataSize() > 0) {
-            valueChunkList.add(
-                new Chunk(
-                    chunkHeader, tsFileSequenceReader.readChunk(-1, 
chunkHeader.getDataSize())));
-            currentMeasurements.add(
-                new MeasurementSchema(chunkHeader.getMeasurementID(), 
chunkHeader.getDataType()));
+            if (Objects.isNull(currentDevice)
+                || !pattern.matchesMeasurement(currentDevice, 
chunkHeader.getMeasurementID())) {
+              tsFileSequenceReader.position(
+                  tsFileSequenceReader.position() + chunkHeader.getDataSize());
+              break;
+            }

Review Comment:
   Here too. Even if a chunk is filtered out, `measurementIndexMap` should also 
be updated. Otherwise, you may link a value chunk to a wrong time chunk.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to