Skip to content

Commit

Permalink
Adding more TODOs to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JackKelly committed Sep 4, 2024
1 parent d83e2c7 commit d291e46
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions crates/hypergrib_manifest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,17 @@ fn read_idx_into_duck_db(filename: String) -> anyhow::Result<()> {
init_time TIMESTAMP,
nwp_variable VARCHAR,
vertical_level VARCHAR,
step VARCHAR,
member VARCHAR,
step_raw VARCHAR,
step INTERVAL,
ens_member VARCHAR,
);
",
)?;
// TODO: Change to enums: nwp_variable, vertical_level, ensemble_member
// TODO: Change to INTERVAL: step
// TODO: Add filename
// TODO: Convert init_time to DATETIME
// TODO: Add filename of GRIB file (with full path)

conn.execute_batch(
r"COPY grib_message FROM
r"COPY grib_message (msg_id, byte_offset, init_time, nwp_variable, vertical_level, step_raw, ens_member) FROM
'/home/jack/dev/rust/hypergrib/gec00.t00z.pgrb2af000.idx'
(
DELIMITER ':',
Expand All @@ -55,7 +54,11 @@ fn read_idx_into_duck_db(filename: String) -> anyhow::Result<()> {
TIMESTAMPFORMAT 'd=%Y%m%d%H'
);
",
)?; // TODO: Pass in filename!
)?;
// TODO: Pass in filename argument!
// TODO: Convert step_raw to step, maybe by first storing step_raw as VARCHAR, replacing 'anl'
// with '0', taking just the first two characters of the string, converting that to an int, and
// passing that to [`to_hours(integer)`](https://duckdb.org/docs/sql/functions/interval#to_hoursinteger)

// Print some test data:
let mut stmt = conn.prepare("SELECT * FROM grib_message WHERE msg_id < 5")?;
Expand Down

0 comments on commit d291e46

Please sign in to comment.