macro_rules! make_partition {
{} => { ... };
{$($keys:expr => $vals:expr),+ $(,)?} => { ... };
}Expand description
Outputs a partition, given native Rust key => value pairings.
Since instantiating protobuf-generated types is very verbose,
this macro exists to make partitions
(HashMap<String, PartitionFieldValue>) with ease:
use pancake_db_client::make_partition;
use std::time::SystemTime;
let my_partition = make_partition! {
"t" => SystemTime::now(),
"action" => "click".to_string(),
"is_final" => true,
"int_bucket" => 7,
};Keys can be any type supporting .to_string().
Values can be i64s, bools, Strings, or Timestamps.