Skip to content

Commit da6870d

Browse files
authored
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 <db@domibel.de> Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
1 parent 64a2525 commit da6870d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cpp/tools/parquet/parquet_scan.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "parquet/api/reader.h"
2424

2525
int main(int argc, char** argv) {
26-
if (argc > 4 || argc < 1) {
26+
if (argc > 4 || argc < 2) {
2727
std::cerr << "Usage: parquet-scan [--batch-size=] [--columns=...] <file>"
2828
<< std::endl;
2929
return -1;

0 commit comments

Comments
 (0)