Skip to content

passcod/explore-avro

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

explore-avro

A CLI for Apache Avro exploration.

Screenshot

Installation

Compile from Source

cargo install --git https://github.com/passcod/explore-avro explore-avro

Usage

> # Retrieve all columns for a list of records
> explore-avro get test.avro

+-----------+--------------+-----+
| firstName | lastName     | age |
+-----------+--------------+-----+
| Marty     | McFly        | 24  |
+-----------+--------------+-----+
| Biff      | Tannen       | 72  |
+-----------+--------------+-----+
| Emmett    | Brown        | 65  |
+-----------+--------------+-----+
| Loraine   | Baines-McFly | 62  |
+-----------+--------------+-----+

> # Search (using regular expressions)
> explore-avro get test.avro --search McFly

+-----------+--------------+-----+
| firstName | lastName     | age |
+-----------+--------------+-----+
| Marty     | McFly        | 24  | # the second field will appear in bold green here
+-----------+--------------+-----+
| Loraine   | Baines-McFly | 62  | # the second field will appear in bold green here
+-----------+--------------+-----+

> # Select only some columns
> explore-avro get test.avro --fields firstName age

+-----------+-----+
| firstName | age |
+-----------+-----+
| Marty     | 24  |
+-----------+-----+
| Biff      | 72  |
+-----------+-----+
| Emmett    | 65  |
+-----------+-----+
| Loraine   | 62  |
+-----------+-----+

> # Select the first 2 columns
> explore-avro get test*.avro --fields firstName age --take 2

+-----------+-----+
| firstName | age |
+-----------+-----+
| Marty     | 24  |
+-----------+-----+
| Biff      | 72  |
+-----------+-----+

> # Output as CSV
> explore-avro get test*.avro --fields firstName age --take 2 --format csv

firstName,age
Marty,24
Biff,72

> # Output as JSON
> explore-avro get test*.avro --fields firstName age --take 2 --format csv

{"firstName":"Marty","age":24}
{"firstName":"Biff","age":72}

Options

  • fields (f) - The list (separated by spaces) of the fields you wish to retrieve
  • search (s) - The regular expression to filter and display only rows with columns that contain matching values. The matching fields will be highlighed
  • take (t) - The number of records you wish to retrieve
  • format (p) - The format you wish to output the Avro - omit for a pretty print as a table, or specify "csv" for CSV

About

Simple CLI for Apache Avro with a high-level API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Rust 100.0%