January 2020
Intermediate to advanced
532 pages
13h 31m
English
The preceding sample case works fine for any flat data structure. Nowadays, it is not uncommon to design types that contain other composite types. Let's drill down a little bit deeper to see how we can handle such a nested structure.
First, suppose that we want to separate the fields related to the fare in a separate composite data type:
struct TripPayment vendor_id::String tpep_pickup_datetime::String tpep_dropoff_datetime::String passenger_count::Int trip_distance::Float64 fare::Fareendstruct Fare fare_amount::Float64 extra::Float64 mta_tax::Float64 tip_amount::Float64 tolls_amount::Float64 improvement_surcharge::Float64 total_amount::Float64end
We can adjust the file reader slightly:
function read_trip_payment_file(file) ...
Read now
Unlock full access