Jackie-Jiang commented on code in PR #13082:
URL: https://github.com/apache/pinot/pull/13082#discussion_r1593117462


##########
pinot-plugins/pinot-input-format/pinot-parquet/src/test/java/org/apache/pinot/plugin/inputformat/parquet/ParquetNativeRecordReaderFullTest.java:
##########
@@ -128,16 +128,22 @@ protected void testParquetFile(String filePath)
       throws Exception {
     File dataFile = new 
File(URLDecoder.decode(getClass().getClassLoader().getResource(filePath).getFile(),
         StandardCharsets.UTF_8));
-    ParquetNativeRecordReader recordReader = new ParquetNativeRecordReader();
-    recordReader.init(dataFile, null, null);
-    while (recordReader.hasNext()) {
-      recordReader.next();
-    }
-    recordReader.rewind();
-    while (recordReader.hasNext()) {
-      recordReader.next();
+    try (ParquetNativeRecordReader recordReader = new 
ParquetNativeRecordReader()) {
+        recordReader.init(dataFile, null, null);
+        int numDocsForFirstPass = 0;
+        while (recordReader.hasNext()) {
+          recordReader.next();
+          numDocsForFirstPass++;
+        }
+        recordReader.rewind();
+        int numDocsForSecondPass = 0;
+        while (recordReader.hasNext()) {
+          recordReader.next();
+          numDocsForSecondPass++;
+        }
+        recordReader.close();
+        Assert.assertEquals(numDocsForFirstPass, numDocsForSecondPass);
+    } catch (AssertionError e) {

Review Comment:
   ```suggestion
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to