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

dongjoon pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/orc.git


The following commit(s) were added to refs/heads/main by this push:
     new 90dd4bd9f ORC-1646: Close the reader when reading the schema with the 
`convert` command
90dd4bd9f is described below

commit 90dd4bd9fec80e391566e38a29cd02eaf4737af5
Author: sychen <[email protected]>
AuthorDate: Mon Mar 11 14:30:12 2024 -0700

    ORC-1646: Close the reader when reading the schema with the `convert` 
command
    
    ### What changes were proposed in this pull request?
    This PR aims to close the reader when reading the schema with the `convert` 
command.
    
    ### Why are the changes needed?
    When using the `convert` command, when the input file format is ORC, the 
ORC schema is read, but not the close ORC reader.
    
    ### How was this patch tested?
    local test
    
    ### Was this patch authored or co-authored using generative AI tooling?
    No
    
    Closes #1837 from cxzl25/ORC-1646.
    
    Authored-by: sychen <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 java/tools/src/java/org/apache/orc/tools/convert/ConvertTool.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/java/tools/src/java/org/apache/orc/tools/convert/ConvertTool.java 
b/java/tools/src/java/org/apache/orc/tools/convert/ConvertTool.java
index 585a43fe6..fbdb8696d 100644
--- a/java/tools/src/java/org/apache/orc/tools/convert/ConvertTool.java
+++ b/java/tools/src/java/org/apache/orc/tools/convert/ConvertTool.java
@@ -79,6 +79,7 @@ public class ConvertTool {
         Reader reader = OrcFile.createReader(file.path,
             OrcFile.readerOptions(conf)
                 .filesystem(file.filesystem));
+        reader.close();
         if (files.size() == 1) {
           return reader.getSchema();
         }

Reply via email to