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 Lance field paths the UDTF reads. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Null means all fields (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    #[serde(rename = "partition_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
35    pub partition_by: Option<Option<String>>,
36    #[serde(rename = "partition_by_indexed_column", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
37    pub partition_by_indexed_column: Option<Option<String>>,
38    /// Ray actor CPU request.
39    #[serde(rename = "num_cpus", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
40    pub num_cpus: Option<Option<f64>>,
41    /// Ray actor GPU request.
42    #[serde(rename = "num_gpus", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
43    pub num_gpus: Option<Option<f64>>,
44    /// Ray actor memory request, in bytes.
45    #[serde(rename = "memory", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
46    pub memory: Option<Option<i32>>,
47    /// Batch UDTF only. Serialized ErrorHandlingConfig controlling partition-grain fail/retry/skip behavior. 
48    #[serde(rename = "error_handling", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
49    pub error_handling: Option<Option<serde_json::Value>>,
50    /// Chunker only. True for a batched chunker; affects how the worker dispatches input rows. 
51    #[serde(rename = "batch", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
52    pub batch: Option<Option<bool>>,
53    /// JSON-serialized GenevaManifest for the UDTF environment.
54    #[serde(rename = "manifest", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
55    pub manifest: Option<Option<String>>,
56    /// SHA-256 checksum of the manifest content.
57    #[serde(rename = "manifest_checksum", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
58    pub manifest_checksum: Option<Option<String>>,
59}
60
61impl MaterializedViewUdtfEntry {
62    pub fn new(kind: Kind, udtf: String, udtf_sha: String, udtf_name: String, udtf_version: String) -> MaterializedViewUdtfEntry {
63        MaterializedViewUdtfEntry {
64            kind,
65            udtf,
66            udtf_sha,
67            udtf_name,
68            udtf_version,
69            input_columns: None,
70            partition_by: None,
71            partition_by_indexed_column: None,
72            num_cpus: None,
73            num_gpus: None,
74            memory: None,
75            error_handling: None,
76            batch: None,
77            manifest: None,
78            manifest_checksum: None,
79        }
80    }
81}
82/// Discriminates a batch UDTF (`udtf`, full-overwrite refresh) from a chunker (`chunker`, incremental 1:N refresh). Must match the enclosing request's `kind`. 
83#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
84pub enum Kind {
85    #[serde(rename = "udtf")]
86    Udtf,
87    #[serde(rename = "chunker")]
88    Chunker,
89}
90
91impl Default for Kind {
92    fn default() -> Kind {
93        Self::Udtf
94    }
95}
96