A CLI for Apache Avro exploration.
cargo install --git https://github.com/passcod/explore-avro explore-avro
> # 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}fields (f)- The list (separated by spaces) of the fields you wish to retrievesearch (s)- The regular expression to filter and display only rows with columns that contain matching values. The matching fields will be highlighedtake (t)- The number of records you wish to retrieveformat (p)- The format you wish to output the Avro - omit for a pretty print as a table, or specify "csv" for CSV
