Skip to main content

lance_namespace_reqwest_client/models/
materialized_view_udtf_entry.rs

1/*
2 * Lance Namespace Specification
3 *
4 * 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. 
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct MaterializedViewUdtfEntry {
16    /// Discriminates a batch UDTF (`udtf`, full-overwrite refresh) from a chunker (`chunker`, incremental 1:N refresh). Must match the enclosing request's `kind`. 
17    #[serde(rename = "kind")]
18    pub kind: Kind,
19    /// Base64-encoded UDTFSpec / ChunkerSpec JSON envelope (per kind). 
20    #[serde(rename = "udtf")]
21    pub udtf: String,
22    /// SHA-256 checksum of the envelope; server validates.
23    #[serde(rename = "udtf_sha")]
24    pub udtf_sha: String,
25    /// Name of the UDTF
26    #[serde(rename = "udtf_name")]
27    pub udtf_name: String,
28    /// Version of the UDTF
29    #[serde(rename = "udtf_version")]
30    pub udtf_version: String,
31    /// Source columns the UDTF reads. Null means all columns (batch UDTF only). 
32    #[serde(rename = "input_columns", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
33    pub input_columns: Option<Option<Vec<String>>>,
34    /// Batch UDTF only. Column-value partition key for partition-parallel execution. Mutually exclusive with `partition_by_indexed_column`. 
35    #[serde(rename = "partition_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub partition_by: Option<Option<String>>,
37    /// Batch UDTF only. Source column with an IVF-family index used for index-based partitioning. The server validates the index exists at create time. 
38    #[serde(rename = "partition_by_indexed_column", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
39    pub partition_by_indexed_column: Option<Option<String>>,
40    /// Ray actor CPU request.
41    #[serde(rename = "num_cpus", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
42    pub num_cpus: Option<Option<f64>>,
43    /// Ray actor GPU request.
44    #[serde(rename = "num_gpus", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
45    pub num_gpus: Option<Option<f64>>,
46    /// Ray actor memory request, in bytes.
47    #[serde(rename = "memory", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
48    pub memory: Option<Option<i32>>,
49    /// Batch UDTF only. Serialized ErrorHandlingConfig controlling partition-grain fail/retry/skip behavior. 
50    #[serde(rename = "error_handling", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
51    pub error_handling: Option<Option<serde_json::Value>>,
52    /// Chunker only. True for a batched chunker; affects how the worker dispatches input rows. 
53    #[serde(rename = "batch", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
54    pub batch: Option<Option<bool>>,
55    /// JSON-serialized GenevaManifest for the UDTF environment.
56    #[serde(rename = "manifest", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
57    pub manifest: Option<Option<String>>,
58    /// SHA-256 checksum of the manifest content.
59    #[serde(rename = "manifest_checksum", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
60    pub manifest_checksum: Option<Option<String>>,
61}
62
63impl MaterializedViewUdtfEntry {
64    pub fn new(kind: Kind, udtf: String, udtf_sha: String, udtf_name: String, udtf_version: String) -> MaterializedViewUdtfEntry {
65        MaterializedViewUdtfEntry {
66            kind,
67            udtf,
68            udtf_sha,
69            udtf_name,
70            udtf_version,
71            input_columns: None,
72            partition_by: None,
73            partition_by_indexed_column: None,
74            num_cpus: None,
75            num_gpus: None,
76            memory: None,
77            error_handling: None,
78            batch: None,
79            manifest: None,
80            manifest_checksum: None,
81        }
82    }
83}
84/// Discriminates a batch UDTF (`udtf`, full-overwrite refresh) from a chunker (`chunker`, incremental 1:N refresh). Must match the enclosing request's `kind`. 
85#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
86pub enum Kind {
87    #[serde(rename = "udtf")]
88    Udtf,
89    #[serde(rename = "chunker")]
90    Chunker,
91}
92
93impl Default for Kind {
94    fn default() -> Kind {
95        Self::Udtf
96    }
97}
98