hotdata 0.14.0

Powerful data platform API for datasets, queries, and analytics.
Documentation
/*
 * Hotdata API
 *
 * Powerful data platform API for managed databases, queries, and analytics.
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: developers@hotdata.dev
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// TablePartitionKey : One partition key of a table's storage layout.  Partitioning groups rows that share a key value into their own files, so a query filtering on that key reads only the matching files. Keys are applied in the order given, and several keys may read the same column: to get one partition per calendar month, declare `year` and `month` on the timestamp column. A single calendar transform on its own is rarely what you want — `month` alone puts every March of every year in one partition.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TablePartitionKey {
    /// Column the key reads.
    #[serde(rename = "column")]
    pub column: String,
    /// How the value is derived from the column. One of `identity` (the column value itself), `year`, `month`, `day`, or `hour`.
    #[serde(rename = "transform")]
    pub transform: String,
}

impl TablePartitionKey {
    /// One partition key of a table's storage layout.  Partitioning groups rows that share a key value into their own files, so a query filtering on that key reads only the matching files. Keys are applied in the order given, and several keys may read the same column: to get one partition per calendar month, declare `year` and `month` on the timestamp column. A single calendar transform on its own is rarely what you want — `month` alone puts every March of every year in one partition.
    pub fn new(column: String, transform: String) -> TablePartitionKey {
        TablePartitionKey { column, transform }
    }
}