This is an automated email from the ASF dual-hosted git repository.
tustvold pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/master by this push:
new e52574c8b minor: make Parquet CLI input args consistent (#3786)
e52574c8b is described below
commit e52574c8b02410128f35d65aa92d4876b1404d6c
Author: Xinyu Zeng <[email protected]>
AuthorDate: Fri Mar 3 19:39:26 2023 +0800
minor: make Parquet CLI input args consistent (#3786)
* make input args consistent
* positional arg for filename
* make all mandatory args positional
* pyspark integration
* fix
---
parquet/pytest/test_parquet_integration.py | 6 ++----
parquet/src/bin/parquet-read.rs | 2 +-
parquet/src/bin/parquet-rowcount.rs | 2 --
parquet/src/bin/parquet-schema.rs | 2 +-
parquet/src/bin/parquet-show-bloom-filter.rs | 12 +++---------
5 files changed, 7 insertions(+), 17 deletions(-)
diff --git a/parquet/pytest/test_parquet_integration.py
b/parquet/pytest/test_parquet_integration.py
index 268caa8fa..e0846d4e7 100755
--- a/parquet/pytest/test_parquet_integration.py
+++ b/parquet/pytest/test_parquet_integration.py
@@ -68,15 +68,13 @@ def get_show_filter_cli_output(output_dir, data,
col_name="id"):
(parquet_file,) = sorted(pathlib.Path(output_dir).glob("*.parquet"))
args = [
"parquet-show-bloom-filter",
- "--file-name",
parquet_file,
- "--column",
col_name,
]
for v in data:
- args.extend(["--values", v[0]])
+ args.extend([v[0]])
for v in data:
- args.extend(["--values", v[1]])
+ args.extend([v[1]])
return subprocess.check_output(args)
diff --git a/parquet/src/bin/parquet-read.rs b/parquet/src/bin/parquet-read.rs
index c1e08387a..a8a835ab8 100644
--- a/parquet/src/bin/parquet-read.rs
+++ b/parquet/src/bin/parquet-read.rs
@@ -45,7 +45,7 @@ use std::{fs::File, path::Path};
#[derive(Debug, Parser)]
#[clap(author, version, about("Binary file to read data from a Parquet file"),
long_about = None)]
struct Args {
- #[clap(short, long, help("Path to a parquet file, or - for stdin"))]
+ #[clap(help("Path to a parquet file, or - for stdin"))]
file_name: String,
#[clap(
short,
diff --git a/parquet/src/bin/parquet-rowcount.rs
b/parquet/src/bin/parquet-rowcount.rs
index 45eb1c9a4..55c76c5f7 100644
--- a/parquet/src/bin/parquet-rowcount.rs
+++ b/parquet/src/bin/parquet-rowcount.rs
@@ -44,8 +44,6 @@ use std::{fs::File, path::Path};
#[clap(author, version, about("Binary file to return the number of rows found
from Parquet file(s)"), long_about = None)]
struct Args {
#[clap(
- short,
- long,
number_of_values(1),
help("List of Parquet files to read from separated by space")
)]
diff --git a/parquet/src/bin/parquet-schema.rs
b/parquet/src/bin/parquet-schema.rs
index ae79fe429..bfcb77d67 100644
--- a/parquet/src/bin/parquet-schema.rs
+++ b/parquet/src/bin/parquet-schema.rs
@@ -46,7 +46,7 @@ use std::{fs::File, path::Path};
#[derive(Debug, Parser)]
#[clap(author, version, about("Binary file to print the schema and metadata of
a Parquet file"), long_about = None)]
struct Args {
- #[clap(short, long)]
+ #[clap(help("Path to the parquet file"))]
file_path: String,
#[clap(short, long, help("Enable printing full file metadata"))]
verbose: bool,
diff --git a/parquet/src/bin/parquet-show-bloom-filter.rs
b/parquet/src/bin/parquet-show-bloom-filter.rs
index 77e29c6fb..80db51978 100644
--- a/parquet/src/bin/parquet-show-bloom-filter.rs
+++ b/parquet/src/bin/parquet-show-bloom-filter.rs
@@ -25,7 +25,7 @@
//! ```
//! After this `parquet-show-bloom-filter` should be available:
//! ```
-//! parquet-show-bloom-filter --file-name XYZ.parquet --column id --values a
+//! parquet-show-bloom-filter XYZ.parquet id a
//! ```
//!
//! The binary can also be built from the source code and run as follows:
@@ -44,17 +44,11 @@ use std::{fs::File, path::Path};
#[derive(Debug, Parser)]
#[clap(author, version, about("Binary file to read bloom filter data from a
Parquet file"), long_about = None)]
struct Args {
- #[clap(short, long, help("Path to the parquet file"))]
+ #[clap(help("Path to the parquet file"))]
file_name: String,
- #[clap(
- short,
- long,
- help("Check the bloom filter indexes for the given column")
- )]
+ #[clap(help("Check the bloom filter indexes for the given column"))]
column: String,
#[clap(
- short,
- long,
help("Check if the given values match bloom filter, the values will be
evaluated as strings"),
required = true
)]