From 57119676df6c29609329158cfd07e6fa53fb9607 Mon Sep 17 00:00:00 2001 From: Filipe Regadas Date: Fri, 7 Feb 2020 10:06:20 -0500 Subject: [PATCH] Update README --- README.md | 84 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 73 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index e7381f9..cf089ed 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,8 @@ Usage: tfr [options] If enabled checks CRC32 on each record --number | -n Number of records to output + --flat | -f + Output examples as flat JSON objects ``` ## Examples @@ -50,7 +52,67 @@ tfr -n 1 core/src/test/resources/part-00000-of-00004.tfrecords | jq . cat core/src/test/resources/part-00000-of-00004.tfrecords | tfr -n 1 | jq . ``` -### Output Example +### Output + +#### Flat + +```json +{ + "tips": [ + 0 + ], + "trip_seconds": [ + 60 + ], + "payment_type": [ + "Cash" + ], + "trip_miles": [ + 0 + ], + "dropoff_longitude": [ + -87.63785 + ], + "dropoff_latitude": [ + 41.893215 + ], + "pickup_longitude": [ + -87.63187 + ], + "pickup_latitude": [ + 41.89204 + ], + "trip_start_timestamp": [ + 1402934400 + ], + "trip_start_day": [ + 2 + ], + "trip_start_hour": [ + 16 + ], + "trip_start_month": [ + 6 + ], + "fare": [ + 3.25 + ], + "dropoff_census_tract": [ + "17031081800" + ], + "dropoff_community_area": [ + "8" + ], + "pickup_community_area": [ + "8" + ], + "trip_id": [ + "8106c1f6-e6f3-426f-9aaf-b4e9703b4f10" + ] +} +``` + +#### Default ```json { @@ -66,14 +128,14 @@ cat core/src/test/resources/part-00000-of-00004.tfrecords | tfr -n 1 | jq . "trip_seconds": { "int64List": { "value": [ - "60" + 60 ] } }, "payment_type": { "bytesList": { "value": [ - "Q2FzaA==" + "Cash" ] } }, @@ -115,28 +177,28 @@ cat core/src/test/resources/part-00000-of-00004.tfrecords | tfr -n 1 | jq . "trip_start_timestamp": { "int64List": { "value": [ - "1402934400" + 1402934400 ] } }, "trip_start_day": { "int64List": { "value": [ - "2" + 2 ] } }, "trip_start_hour": { "int64List": { "value": [ - "16" + 16 ] } }, "trip_start_month": { "int64List": { "value": [ - "6" + 6 ] } }, @@ -150,28 +212,28 @@ cat core/src/test/resources/part-00000-of-00004.tfrecords | tfr -n 1 | jq . "dropoff_census_tract": { "bytesList": { "value": [ - "MTcwMzEwODE4MDA=" + "17031081800" ] } }, "dropoff_community_area": { "bytesList": { "value": [ - "OA==" + "8" ] } }, "pickup_community_area": { "bytesList": { "value": [ - "OA==" + "8" ] } }, "trip_id": { "bytesList": { "value": [ - "ODEwNmMxZjYtZTZmMy00MjZmLTlhYWYtYjRlOTcwM2I0ZjEw" + "8106c1f6-e6f3-426f-9aaf-b4e9703b4f10" ] } }