Proposal: Use more concise data types

#15
by Jack-Kelly - opened
Open Climate Fix org
edited 9 days ago

The Parquet files in this dataset currently use 64-bit signed integers for the SS_ID; and 64-bit floats for the generation_Wh.

I'd like to propose that we use more concise data types. Specifically, I'd propose that we use 32-bit unsigned ints for the SS_ID; and 32-bit floats for the generation_Wh.

(32-bit unsigned ints can represent up to 4 billion. The largest SS_ID is 193,013.)

This reduces the uncompressed data size for a year of 30-minutely data from 10.5 GB to 6.1 GB (if using the "tall and thin" data shape).

If using the "pivoted" data shape, swapping from f64 to f32 reduces the uncompresed size from 3.5 GB to 1.8 GB.

(See issue #14 for a discussion of "pivoted" versus "tall and thin" data shapes.)

(And, note that the data is always uncompressed when it is read into RAM. So the most significant reason to reduce the data types is to reduce the memory pressure when loading the data, which can make the difference between an operation "just working", versus having to do some manual chunking to get the same operation to fit into RAM).

Jack-Kelly changed discussion title from Proposal: Use more consise data types to Proposal: Use more concise data types
Open Climate Fix org

I'm now thinking that, perhaps, we should leave the data types as-is in this repo. And maybe I'll publish a cleaned and optimised version of this dataset elsewhere (see issue #16).

Open Climate Fix org

I'm about to push files which use float32 for generation_Wh, and int32 for the ss_id. So this is done. I just need to update the dagster conversion script...

Jack-Kelly changed discussion status to closed
Your need to confirm your account before you can post a new comment.

Sign up or log in to comment