/*
* Lance Namespace Specification
*
* This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details.
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// PartitionField : Partition field definition
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PartitionField {
/// Unique identifier for this partition field (must not be renamed)
#[serde(rename = "field_id")]
pub field_id: String,
/// Field IDs of the source columns in the schema
#[serde(rename = "source_ids")]
pub source_ids: Vec<i32>,
/// Well-known partition transform. Exactly one of transform or expression must be specified.
#[serde(rename = "transform", skip_serializing_if = "Option::is_none")]
pub transform: Option<Box<models::PartitionTransform>>,
/// DataFusion SQL expression using col0, col1, ... as column references. Exactly one of transform or expression must be specified.
#[serde(rename = "expression", skip_serializing_if = "Option::is_none")]
pub expression: Option<String>,
/// The output type of the partition value (JsonArrowDataType format)
#[serde(rename = "result_type")]
pub result_type: Box<models::JsonArrowDataType>,
}
impl PartitionField {
/// Partition field definition
pub fn new(field_id: String, source_ids: Vec<i32>, result_type: models::JsonArrowDataType) -> PartitionField {
PartitionField {
field_id,
source_ids,
transform: None,
expression: None,
result_type: Box::new(result_type),
}
}
}