This is an automated email from the ASF dual-hosted git repository.

agrove pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-comet.git


The following commit(s) were added to refs/heads/main by this push:
     new 522410851 fix: check if handle has been initialized before closing 
(#1554)
522410851 is described below

commit 52241085181449e4bdb3345b035bf28fef5b6c34
Author: Zhen Wang <[email protected]>
AuthorDate: Fri Mar 21 05:28:42 2025 +0800

    fix: check if handle has been initialized before closing (#1554)
    
    * fix: check if handle has been initialized before closing
    
    * address comments
---
 common/src/main/java/org/apache/comet/parquet/NativeBatchReader.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/common/src/main/java/org/apache/comet/parquet/NativeBatchReader.java 
b/common/src/main/java/org/apache/comet/parquet/NativeBatchReader.java
index 7e6a5ddfa..0051b412c 100644
--- a/common/src/main/java/org/apache/comet/parquet/NativeBatchReader.java
+++ b/common/src/main/java/org/apache/comet/parquet/NativeBatchReader.java
@@ -459,7 +459,10 @@ public class NativeBatchReader extends RecordReader<Void, 
ColumnarBatch> impleme
       importer = null;
     }
     nativeUtil.close();
-    Native.closeRecordBatchReader(this.handle);
+    if (this.handle > 0) {
+      Native.closeRecordBatchReader(this.handle);
+      this.handle = 0;
+    }
   }
 
   @SuppressWarnings("deprecation")


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

Reply via email to