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

Commit 6b19cd2

Browse files
sadikovisunchao
authored andcommitted
Update binaries and readme (#69)
1 parent 67636b0 commit 6b19cd2

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ Run `cargo build` or `cargo build --release` to build in release mode.
2727
## Test
2828
Run `cargo test` for unit tests.
2929

30+
## Binaries
31+
The following binaries are provided (use `cargo install` to install them):
32+
- **parquet-schema** for printing Parquet file schema and metadata.
33+
`Usage: parquet-schema <file-path> [verbose]`, where `file-path` is the path to a Parquet file,
34+
and optional `verbose` is the boolean flag that allows to print full metadata or schema only
35+
(when not specified only schema will be printed).
36+
37+
- **parquet-read** for reading records from a Parquet file.
38+
`Usage: parquet-read <file-path> [num-records]`, where `file-path` is the path to a Parquet file,
39+
and `num-records` is the number of records to read from a file (when not specified all records will
40+
be printed).
41+
3042
## Benchmarks
3143
Run `cargo bench` for benchmarks.
3244

src/bin/parquet-read.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use parquet::file::reader::{FileReader, SerializedFileReader};
1010
fn main() {
1111
let args: Vec<String> = env::args().collect();
1212
if args.len() != 2 && args.len() != 3 {
13-
println!("Usage: read-file <file-path> [num-records]");
13+
println!("Usage: parquet-read <file-path> [num-records]");
1414
process::exit(1);
1515
}
1616

src/bin/parquet-schema.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ use parquet::schema::printer::{print_parquet_metadata, print_file_metadata};
2828
fn main() {
2929
let args: Vec<String> = env::args().collect();
3030
if args.len() != 2 && args.len() != 3 {
31-
println!("Usage: dump-schema <file-path> <verbose>");
31+
println!("Usage: parquet-schema <file-path> [verbose]");
3232
process::exit(1);
3333
}
3434
let path = Path::new(&args[1]);
3535
let mut verbose = false;
3636
if args.len() == 3 {
3737
match args[2].parse() {
3838
Ok(b) => verbose = b,
39-
Err(e) => panic!("Error when reading value for <verbose> \
39+
Err(e) => panic!("Error when reading value for [verbose] \
4040
(expected either 'true' or 'false'): {}", e)
4141
}
4242
}

src/schema/printer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub fn print_schema(out: &mut io::Write, tp: &Type) {
5959
let mut printer = Printer::new(&mut s);
6060
printer.print(tp);
6161
}
62-
write!(out, "{}", s);
62+
writeln!(out, "{}", s);
6363
}
6464

6565
#[allow(unused_must_use)]

0 commit comments

Comments
 (0)