Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

Commit

Permalink
Update binaries and readme (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
sadikovi authored and sunchao committed Mar 31, 2018
1 parent 67636b0 commit 6b19cd2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ Run `cargo build` or `cargo build --release` to build in release mode.
## Test
Run `cargo test` for unit tests.

## Binaries
The following binaries are provided (use `cargo install` to install them):
- **parquet-schema** for printing Parquet file schema and metadata.
`Usage: parquet-schema <file-path> [verbose]`, where `file-path` is the path to a Parquet file,
and optional `verbose` is the boolean flag that allows to print full metadata or schema only
(when not specified only schema will be printed).

- **parquet-read** for reading records from a Parquet file.
`Usage: parquet-read <file-path> [num-records]`, where `file-path` is the path to a Parquet file,
and `num-records` is the number of records to read from a file (when not specified all records will
be printed).

## Benchmarks
Run `cargo bench` for benchmarks.

Expand Down
2 changes: 1 addition & 1 deletion src/bin/parquet-read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use parquet::file::reader::{FileReader, SerializedFileReader};
fn main() {
let args: Vec<String> = env::args().collect();
if args.len() != 2 && args.len() != 3 {
println!("Usage: read-file <file-path> [num-records]");
println!("Usage: parquet-read <file-path> [num-records]");
process::exit(1);
}

Expand Down
4 changes: 2 additions & 2 deletions src/bin/parquet-schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ use parquet::schema::printer::{print_parquet_metadata, print_file_metadata};
fn main() {
let args: Vec<String> = env::args().collect();
if args.len() != 2 && args.len() != 3 {
println!("Usage: dump-schema <file-path> <verbose>");
println!("Usage: parquet-schema <file-path> [verbose]");
process::exit(1);
}
let path = Path::new(&args[1]);
let mut verbose = false;
if args.len() == 3 {
match args[2].parse() {
Ok(b) => verbose = b,
Err(e) => panic!("Error when reading value for <verbose> \
Err(e) => panic!("Error when reading value for [verbose] \
(expected either 'true' or 'false'): {}", e)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/schema/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub fn print_schema(out: &mut io::Write, tp: &Type) {
let mut printer = Printer::new(&mut s);
printer.print(tp);
}
write!(out, "{}", s);
writeln!(out, "{}", s);
}

#[allow(unused_must_use)]
Expand Down

0 comments on commit 6b19cd2

Please sign in to comment.