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

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


The following commit(s) were added to refs/heads/main by this push:
     new da6870deba GH-49539: [C++][Parquet] Fix argument count check in 
parquet_scan (#49540)
da6870deba is described below

commit da6870debad68504ac83f3adeee863ab8a5c1999
Author: Dominique Belhachemi <[email protected]>
AuthorDate: Tue Apr 7 03:36:21 2026 -0400

    GH-49539: [C++][Parquet] Fix argument count check in parquet_scan (#49540)
    
    ### Rationale for this change
    Running parquet-scan without arguments currently triggers a confusing 
IOError instead of showing how to use the tool.
    
    ### What changes are included in this PR?
    Updated the argument validation from argc < 1 (always false) to argc < 2.
    
    ### Are these changes tested?
    Yes.
    
    ### Are there any user-facing changes?
    Yes.
    
    Old behavior:
    $ parquet-scan
    Parquet error: IOError: Failed to open local file ''. Detail: [errno 2] No 
such file or directory
    
    New behavior:
    $ parquet-scan
    Usage: parquet-scan [--batch-size=] [--columns=...]
    
    * GitHub Issue: #49539
    
    Authored-by: Dominique Belhachemi <[email protected]>
    Signed-off-by: Raúl Cumplido <[email protected]>
---
 cpp/tools/parquet/parquet_scan.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpp/tools/parquet/parquet_scan.cc 
b/cpp/tools/parquet/parquet_scan.cc
index b6381472e1..a6051f4d19 100644
--- a/cpp/tools/parquet/parquet_scan.cc
+++ b/cpp/tools/parquet/parquet_scan.cc
@@ -23,7 +23,7 @@
 #include "parquet/api/reader.h"
 
 int main(int argc, char** argv) {
-  if (argc > 4 || argc < 1) {
+  if (argc > 4 || argc < 2) {
     std::cerr << "Usage: parquet-scan [--batch-size=] [--columns=...] <file>"
               << std::endl;
     return -1;

Reply via email to