Skip to main content

risingwave_pb/
expr.rs

1// This file is @generated by prost-build.
2/// A reference to a secret, resolved at runtime via LocalSecretManager.
3/// Only secret_id is serialized — the actual value never appears in plans.
4#[derive(prost_helpers::AnyPB)]
5#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
6pub struct SecretRefNode {
7    #[prost(uint32, tag = "1")]
8    pub secret_id: u32,
9    #[prost(enumeration = "super::secret::secret_ref::RefAsType", tag = "2")]
10    pub ref_as: i32,
11}
12#[derive(prost_helpers::AnyPB)]
13#[derive(Eq, Hash)]
14#[derive(Clone, PartialEq, ::prost::Message)]
15pub struct ExprNode {
16    /// Only use this field for function call. For other types of expression, it should be UNSPECIFIED.
17    #[prost(enumeration = "expr_node::Type", tag = "1")]
18    pub function_type: i32,
19    #[prost(message, optional, tag = "3")]
20    pub return_type: ::core::option::Option<super::data::DataType>,
21    #[prost(oneof = "expr_node::RexNode", tags = "4, 5, 6, 7, 8, 9")]
22    pub rex_node: ::core::option::Option<expr_node::RexNode>,
23}
24/// Nested message and enum types in `ExprNode`.
25pub mod expr_node {
26    #[derive(prost_helpers::AnyPB)]
27    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
28    pub struct NowRexNode {}
29    /// TODO: move this into `FunctionCall`.
30    #[derive(prost_helpers::AnyPB)]
31    #[derive(
32        Clone,
33        Copy,
34        Debug,
35        PartialEq,
36        Eq,
37        Hash,
38        PartialOrd,
39        Ord,
40        ::prost::Enumeration
41    )]
42    #[repr(i32)]
43    pub enum Type {
44        /// Used for `InputRef`, `Constant`, and `UserDefinedFunction`.
45        Unspecified = 0,
46        /// arithmetics operators
47        Add = 3,
48        Subtract = 4,
49        Multiply = 5,
50        Divide = 6,
51        Modulus = 7,
52        /// comparison operators
53        Equal = 8,
54        NotEqual = 9,
55        LessThan = 10,
56        LessThanOrEqual = 11,
57        GreaterThan = 12,
58        GreaterThanOrEqual = 13,
59        Greatest = 14,
60        Least = 15,
61        /// logical operators
62        And = 21,
63        Or = 22,
64        Not = 23,
65        In = 24,
66        Some = 25,
67        All = 26,
68        /// bitwise operators
69        BitwiseAnd = 31,
70        BitwiseOr = 32,
71        BitwiseXor = 33,
72        BitwiseNot = 34,
73        BitwiseShiftLeft = 35,
74        BitwiseShiftRight = 36,
75        /// date/time functions
76        Extract = 101,
77        DatePart = 102,
78        TumbleStart = 103,
79        MakeDate = 113,
80        MakeTime = 114,
81        MakeTimestamp = 115,
82        DateBin = 116,
83        /// From f64 to timestamp.
84        /// e.g. `select to_timestamp(1672044740.0)`
85        SecToTimestamptz = 104,
86        AtTimeZone = 105,
87        DateTrunc = 106,
88        /// Parse text to timestamp by format string.
89        /// e.g. `select to_timestamp('2022 08 21', 'YYYY MM DD')`
90        CharToTimestamptz = 107,
91        CharToDate = 111,
92        /// Performs a cast with additional timezone information.
93        CastWithTimeZone = 108,
94        AddWithTimeZone = 109,
95        SubtractWithTimeZone = 110,
96        MakeTimestamptz = 112,
97        /// other functions
98        Cast = 201,
99        Substr = 202,
100        Length = 203,
101        Like = 204,
102        ILike = 279,
103        SimilarToEscape = 284,
104        Upper = 205,
105        Lower = 206,
106        Trim = 207,
107        Replace = 208,
108        Position = 209,
109        Ltrim = 210,
110        Rtrim = 211,
111        Case = 212,
112        /// Optimize case-when expression to constant lookup
113        /// when arms are in a large scale with simple form
114        ConstantLookup = 624,
115        /// ROUND(numeric, integer) -> numeric
116        RoundDigit = 213,
117        /// ROUND(numeric) -> numeric
118        /// ROUND(double precision) -> double precision
119        Round = 214,
120        Ascii = 215,
121        Translate = 216,
122        Coalesce = 217,
123        ConcatWs = 218,
124        ConcatWsVariadic = 285,
125        Abs = 219,
126        SplitPart = 220,
127        Ceil = 221,
128        Floor = 222,
129        ToChar = 223,
130        Md5 = 224,
131        CharLength = 225,
132        Repeat = 226,
133        ConcatOp = 227,
134        ByteaConcatOp = 290,
135        Concat = 286,
136        ConcatVariadic = 287,
137        /// BOOL_OUT is different from CAST-bool-to-varchar in PostgreSQL.
138        BoolOut = 228,
139        OctetLength = 229,
140        BitLength = 230,
141        Overlay = 231,
142        RegexpMatch = 232,
143        RegexpReplace = 280,
144        RegexpCount = 281,
145        RegexpSplitToArray = 282,
146        RegexpEq = 283,
147        Pow = 233,
148        Exp = 234,
149        Chr = 235,
150        StartsWith = 236,
151        Initcap = 237,
152        Lpad = 238,
153        Rpad = 239,
154        Reverse = 240,
155        /// duplicated with POSITION
156        #[deprecated]
157        Strpos = 241,
158        ToAscii = 242,
159        ToHex = 243,
160        QuoteIdent = 244,
161        Sin = 245,
162        Cos = 246,
163        Tan = 247,
164        Cot = 248,
165        Asin = 249,
166        Acos = 250,
167        Atan = 251,
168        Atan2 = 252,
169        Sind = 253,
170        Cosd = 254,
171        Cotd = 255,
172        Tand = 256,
173        Asind = 257,
174        Sqrt = 258,
175        Degrees = 259,
176        Radians = 260,
177        Cosh = 261,
178        Tanh = 262,
179        Coth = 263,
180        Asinh = 264,
181        Acosh = 265,
182        Atanh = 266,
183        Sinh = 267,
184        Acosd = 268,
185        Atand = 269,
186        Atan2d = 270,
187        Trunc = 271,
188        Ln = 272,
189        Log10 = 273,
190        Cbrt = 274,
191        Sign = 275,
192        Scale = 276,
193        MinScale = 277,
194        TrimScale = 278,
195        Gamma = 288,
196        Lgamma = 289,
197        /// Boolean comparison
198        IsTrue = 301,
199        IsNotTrue = 302,
200        IsFalse = 303,
201        IsNotFalse = 304,
202        IsNull = 305,
203        IsNotNull = 306,
204        IsDistinctFrom = 307,
205        IsNotDistinctFrom = 308,
206        /// string/bytea expressions
207        Encode = 310,
208        Decode = 311,
209        Sha1 = 312,
210        Sha224 = 313,
211        Sha256 = 314,
212        Sha384 = 315,
213        Sha512 = 316,
214        Left = 317,
215        Right = 318,
216        Format = 319,
217        FormatVariadic = 326,
218        PgwireSend = 320,
219        PgwireRecv = 321,
220        ConvertFrom = 322,
221        ConvertTo = 323,
222        Decrypt = 324,
223        Encrypt = 325,
224        InetAton = 328,
225        InetNtoa = 329,
226        QuoteLiteral = 330,
227        QuoteNullable = 331,
228        Hmac = 332,
229        SecureCompare = 333,
230        GetBit = 334,
231        GetByte = 335,
232        SetBit = 336,
233        SetByte = 337,
234        BitCount = 338,
235        Crc32 = 339,
236        Crc32c = 340,
237        /// Constraints Check
238        CheckNotNull = 350,
239        /// Unary operators
240        Neg = 401,
241        /// Nested selection operators
242        Field = 501,
243        /// Array expression.
244        Array = 521,
245        ArrayAccess = 522,
246        Row = 523,
247        ArrayToString = 524,
248        ArrayRangeAccess = 525,
249        /// Array functions
250        ArrayCat = 531,
251        ArrayAppend = 532,
252        ArrayPrepend = 533,
253        FormatType = 534,
254        ArrayDistinct = 535,
255        ArrayLength = 536,
256        Cardinality = 537,
257        ArrayRemove = 538,
258        ArrayPositions = 539,
259        TrimArray = 540,
260        StringToArray = 541,
261        ArrayPosition = 542,
262        ArrayReplace = 543,
263        ArrayDims = 544,
264        ArrayTransform = 545,
265        ArrayMin = 546,
266        ArrayMax = 547,
267        ArraySum = 548,
268        ArraySort = 549,
269        ArrayContains = 550,
270        ArrayContained = 551,
271        ArrayFlatten = 552,
272        ArrayReverse = 553,
273        ArrayOverlaps = 554,
274        /// Int256 functions
275        HexToInt256 = 560,
276        /// jsonb -> int, jsonb -> text that returns jsonb
277        JsonbAccess = 600,
278        /// jsonb ->> int, jsonb ->> text that returns text
279        JsonbAccessStr = 601,
280        /// jsonb #> text\[\] -> jsonb
281        JsonbExtractPath = 627,
282        JsonbExtractPathVariadic = 613,
283        /// jsonb #>> text\[\] -> text
284        JsonbExtractPathText = 628,
285        JsonbExtractPathTextVariadic = 614,
286        JsonbTypeof = 602,
287        JsonbArrayLength = 603,
288        IsJson = 604,
289        JsonbConcat = 605,
290        JsonbObject = 606,
291        JsonbPretty = 607,
292        /// jsonb @> jsonb
293        JsonbContains = 608,
294        /// jsonb \<@ jsonb
295        JsonbContained = 609,
296        /// jsonb ? text
297        JsonbExists = 610,
298        /// jsonb ?| text\[\]
299        JsonbExistsAny = 611,
300        /// jsonb ?& text\[\]
301        JsonbExistsAll = 612,
302        /// see SUBTRACT for:
303        /// jsonb - text -> jsonb
304        /// jsonb - text\[\] -> jsonb
305        /// jsonb - integer -> jsonb
306        ///
307        /// jsonb #- text\[\] -> jsonb
308        JsonbDeletePath = 615,
309        JsonbStripNulls = 616,
310        ToJsonb = 617,
311        JsonbBuildArray = 618,
312        JsonbBuildArrayVariadic = 625,
313        JsonbBuildObject = 619,
314        JsonbBuildObjectVariadic = 626,
315        JsonbPathExists = 620,
316        JsonbPathMatch = 621,
317        JsonbPathQueryArray = 622,
318        JsonbPathQueryFirst = 623,
319        JsonbPopulateRecord = 629,
320        JsonbToRecord = 630,
321        JsonbSet = 631,
322        JsonbPopulateMap = 632,
323        JsonbToArray = 633,
324        /// Map functions
325        MapFromEntries = 700,
326        MapAccess = 701,
327        MapKeys = 702,
328        MapValues = 703,
329        MapEntries = 704,
330        MapFromKeyValues = 705,
331        MapLength = 706,
332        MapContains = 707,
333        MapCat = 708,
334        MapInsert = 709,
335        MapDelete = 710,
336        MapFilter = 711,
337        /// Vector functions
338        L2Distance = 750,
339        CosineDistance = 751,
340        L1Distance = 752,
341        InnerProduct = 753,
342        VecConcat = 754,
343        L2Norm = 755,
344        L2Normalize = 756,
345        Subvector = 757,
346        /// Internal function for schema change
347        CompositeCast = 800,
348        /// ## Non-pure functions below (> 1000)
349        ///
350        /// Internal functions
351        Vnode = 1101,
352        TestFeature = 1102,
353        VnodeUser = 1103,
354        License = 1104,
355        /// Non-deterministic functions
356        Proctime = 2023,
357        PgSleep = 2024,
358        PgSleepFor = 2025,
359        PgSleepUntil = 2026,
360        Random = 2027,
361        ClockTimestamp = 2028,
362        GenRandomUuid = 2029,
363        /// System administration functions
364        CastRegclass = 2100,
365        /// System information functions
366        PgGetIndexdef = 2400,
367        ColDescription = 2401,
368        PgGetViewdef = 2402,
369        PgGetUserbyid = 2403,
370        PgIndexesSize = 2404,
371        PgRelationSize = 2405,
372        PgGetSerialSequence = 2406,
373        PgIndexColumnHasProperty = 2410,
374        HasTablePrivilege = 2407,
375        HasAnyColumnPrivilege = 2408,
376        HasSchemaPrivilege = 2409,
377        PgIsInRecovery = 2411,
378        RwRecoveryStatus = 2412,
379        RwEpochToTs = 2413,
380        PgTableIsVisible = 2414,
381        HasFunctionPrivilege = 2415,
382        HasDatabasePrivilege = 2416,
383        RwClusterId = 2417,
384        RwFragmentVnodes = 2418,
385        RwActorVnodes = 2419,
386        /// EXTERNAL
387        IcebergTransform = 2201,
388        /// AI model functions
389        OpenaiEmbedding = 2501,
390    }
391    impl Type {
392        /// String value of the enum field names used in the ProtoBuf definition.
393        ///
394        /// The values are not transformed in any way and thus are considered stable
395        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
396        pub fn as_str_name(&self) -> &'static str {
397            match self {
398                Self::Unspecified => "UNSPECIFIED",
399                Self::Add => "ADD",
400                Self::Subtract => "SUBTRACT",
401                Self::Multiply => "MULTIPLY",
402                Self::Divide => "DIVIDE",
403                Self::Modulus => "MODULUS",
404                Self::Equal => "EQUAL",
405                Self::NotEqual => "NOT_EQUAL",
406                Self::LessThan => "LESS_THAN",
407                Self::LessThanOrEqual => "LESS_THAN_OR_EQUAL",
408                Self::GreaterThan => "GREATER_THAN",
409                Self::GreaterThanOrEqual => "GREATER_THAN_OR_EQUAL",
410                Self::Greatest => "GREATEST",
411                Self::Least => "LEAST",
412                Self::And => "AND",
413                Self::Or => "OR",
414                Self::Not => "NOT",
415                Self::In => "IN",
416                Self::Some => "SOME",
417                Self::All => "ALL",
418                Self::BitwiseAnd => "BITWISE_AND",
419                Self::BitwiseOr => "BITWISE_OR",
420                Self::BitwiseXor => "BITWISE_XOR",
421                Self::BitwiseNot => "BITWISE_NOT",
422                Self::BitwiseShiftLeft => "BITWISE_SHIFT_LEFT",
423                Self::BitwiseShiftRight => "BITWISE_SHIFT_RIGHT",
424                Self::Extract => "EXTRACT",
425                Self::DatePart => "DATE_PART",
426                Self::TumbleStart => "TUMBLE_START",
427                Self::MakeDate => "MAKE_DATE",
428                Self::MakeTime => "MAKE_TIME",
429                Self::MakeTimestamp => "MAKE_TIMESTAMP",
430                Self::DateBin => "DATE_BIN",
431                Self::SecToTimestamptz => "SEC_TO_TIMESTAMPTZ",
432                Self::AtTimeZone => "AT_TIME_ZONE",
433                Self::DateTrunc => "DATE_TRUNC",
434                Self::CharToTimestamptz => "CHAR_TO_TIMESTAMPTZ",
435                Self::CharToDate => "CHAR_TO_DATE",
436                Self::CastWithTimeZone => "CAST_WITH_TIME_ZONE",
437                Self::AddWithTimeZone => "ADD_WITH_TIME_ZONE",
438                Self::SubtractWithTimeZone => "SUBTRACT_WITH_TIME_ZONE",
439                Self::MakeTimestamptz => "MAKE_TIMESTAMPTZ",
440                Self::Cast => "CAST",
441                Self::Substr => "SUBSTR",
442                Self::Length => "LENGTH",
443                Self::Like => "LIKE",
444                Self::ILike => "I_LIKE",
445                Self::SimilarToEscape => "SIMILAR_TO_ESCAPE",
446                Self::Upper => "UPPER",
447                Self::Lower => "LOWER",
448                Self::Trim => "TRIM",
449                Self::Replace => "REPLACE",
450                Self::Position => "POSITION",
451                Self::Ltrim => "LTRIM",
452                Self::Rtrim => "RTRIM",
453                Self::Case => "CASE",
454                Self::ConstantLookup => "CONSTANT_LOOKUP",
455                Self::RoundDigit => "ROUND_DIGIT",
456                Self::Round => "ROUND",
457                Self::Ascii => "ASCII",
458                Self::Translate => "TRANSLATE",
459                Self::Coalesce => "COALESCE",
460                Self::ConcatWs => "CONCAT_WS",
461                Self::ConcatWsVariadic => "CONCAT_WS_VARIADIC",
462                Self::Abs => "ABS",
463                Self::SplitPart => "SPLIT_PART",
464                Self::Ceil => "CEIL",
465                Self::Floor => "FLOOR",
466                Self::ToChar => "TO_CHAR",
467                Self::Md5 => "MD5",
468                Self::CharLength => "CHAR_LENGTH",
469                Self::Repeat => "REPEAT",
470                Self::ConcatOp => "CONCAT_OP",
471                Self::ByteaConcatOp => "BYTEA_CONCAT_OP",
472                Self::Concat => "CONCAT",
473                Self::ConcatVariadic => "CONCAT_VARIADIC",
474                Self::BoolOut => "BOOL_OUT",
475                Self::OctetLength => "OCTET_LENGTH",
476                Self::BitLength => "BIT_LENGTH",
477                Self::Overlay => "OVERLAY",
478                Self::RegexpMatch => "REGEXP_MATCH",
479                Self::RegexpReplace => "REGEXP_REPLACE",
480                Self::RegexpCount => "REGEXP_COUNT",
481                Self::RegexpSplitToArray => "REGEXP_SPLIT_TO_ARRAY",
482                Self::RegexpEq => "REGEXP_EQ",
483                Self::Pow => "POW",
484                Self::Exp => "EXP",
485                Self::Chr => "CHR",
486                Self::StartsWith => "STARTS_WITH",
487                Self::Initcap => "INITCAP",
488                Self::Lpad => "LPAD",
489                Self::Rpad => "RPAD",
490                Self::Reverse => "REVERSE",
491                #[allow(deprecated)]
492                Self::Strpos => "STRPOS",
493                Self::ToAscii => "TO_ASCII",
494                Self::ToHex => "TO_HEX",
495                Self::QuoteIdent => "QUOTE_IDENT",
496                Self::Sin => "SIN",
497                Self::Cos => "COS",
498                Self::Tan => "TAN",
499                Self::Cot => "COT",
500                Self::Asin => "ASIN",
501                Self::Acos => "ACOS",
502                Self::Atan => "ATAN",
503                Self::Atan2 => "ATAN2",
504                Self::Sind => "SIND",
505                Self::Cosd => "COSD",
506                Self::Cotd => "COTD",
507                Self::Tand => "TAND",
508                Self::Asind => "ASIND",
509                Self::Sqrt => "SQRT",
510                Self::Degrees => "DEGREES",
511                Self::Radians => "RADIANS",
512                Self::Cosh => "COSH",
513                Self::Tanh => "TANH",
514                Self::Coth => "COTH",
515                Self::Asinh => "ASINH",
516                Self::Acosh => "ACOSH",
517                Self::Atanh => "ATANH",
518                Self::Sinh => "SINH",
519                Self::Acosd => "ACOSD",
520                Self::Atand => "ATAND",
521                Self::Atan2d => "ATAN2D",
522                Self::Trunc => "TRUNC",
523                Self::Ln => "LN",
524                Self::Log10 => "LOG10",
525                Self::Cbrt => "CBRT",
526                Self::Sign => "SIGN",
527                Self::Scale => "SCALE",
528                Self::MinScale => "MIN_SCALE",
529                Self::TrimScale => "TRIM_SCALE",
530                Self::Gamma => "GAMMA",
531                Self::Lgamma => "LGAMMA",
532                Self::IsTrue => "IS_TRUE",
533                Self::IsNotTrue => "IS_NOT_TRUE",
534                Self::IsFalse => "IS_FALSE",
535                Self::IsNotFalse => "IS_NOT_FALSE",
536                Self::IsNull => "IS_NULL",
537                Self::IsNotNull => "IS_NOT_NULL",
538                Self::IsDistinctFrom => "IS_DISTINCT_FROM",
539                Self::IsNotDistinctFrom => "IS_NOT_DISTINCT_FROM",
540                Self::Encode => "ENCODE",
541                Self::Decode => "DECODE",
542                Self::Sha1 => "SHA1",
543                Self::Sha224 => "SHA224",
544                Self::Sha256 => "SHA256",
545                Self::Sha384 => "SHA384",
546                Self::Sha512 => "SHA512",
547                Self::Left => "LEFT",
548                Self::Right => "RIGHT",
549                Self::Format => "FORMAT",
550                Self::FormatVariadic => "FORMAT_VARIADIC",
551                Self::PgwireSend => "PGWIRE_SEND",
552                Self::PgwireRecv => "PGWIRE_RECV",
553                Self::ConvertFrom => "CONVERT_FROM",
554                Self::ConvertTo => "CONVERT_TO",
555                Self::Decrypt => "DECRYPT",
556                Self::Encrypt => "ENCRYPT",
557                Self::InetAton => "INET_ATON",
558                Self::InetNtoa => "INET_NTOA",
559                Self::QuoteLiteral => "QUOTE_LITERAL",
560                Self::QuoteNullable => "QUOTE_NULLABLE",
561                Self::Hmac => "HMAC",
562                Self::SecureCompare => "SECURE_COMPARE",
563                Self::GetBit => "GET_BIT",
564                Self::GetByte => "GET_BYTE",
565                Self::SetBit => "SET_BIT",
566                Self::SetByte => "SET_BYTE",
567                Self::BitCount => "BIT_COUNT",
568                Self::Crc32 => "CRC32",
569                Self::Crc32c => "CRC32C",
570                Self::CheckNotNull => "CHECK_NOT_NULL",
571                Self::Neg => "NEG",
572                Self::Field => "FIELD",
573                Self::Array => "ARRAY",
574                Self::ArrayAccess => "ARRAY_ACCESS",
575                Self::Row => "ROW",
576                Self::ArrayToString => "ARRAY_TO_STRING",
577                Self::ArrayRangeAccess => "ARRAY_RANGE_ACCESS",
578                Self::ArrayCat => "ARRAY_CAT",
579                Self::ArrayAppend => "ARRAY_APPEND",
580                Self::ArrayPrepend => "ARRAY_PREPEND",
581                Self::FormatType => "FORMAT_TYPE",
582                Self::ArrayDistinct => "ARRAY_DISTINCT",
583                Self::ArrayLength => "ARRAY_LENGTH",
584                Self::Cardinality => "CARDINALITY",
585                Self::ArrayRemove => "ARRAY_REMOVE",
586                Self::ArrayPositions => "ARRAY_POSITIONS",
587                Self::TrimArray => "TRIM_ARRAY",
588                Self::StringToArray => "STRING_TO_ARRAY",
589                Self::ArrayPosition => "ARRAY_POSITION",
590                Self::ArrayReplace => "ARRAY_REPLACE",
591                Self::ArrayDims => "ARRAY_DIMS",
592                Self::ArrayTransform => "ARRAY_TRANSFORM",
593                Self::ArrayMin => "ARRAY_MIN",
594                Self::ArrayMax => "ARRAY_MAX",
595                Self::ArraySum => "ARRAY_SUM",
596                Self::ArraySort => "ARRAY_SORT",
597                Self::ArrayContains => "ARRAY_CONTAINS",
598                Self::ArrayContained => "ARRAY_CONTAINED",
599                Self::ArrayFlatten => "ARRAY_FLATTEN",
600                Self::ArrayReverse => "ARRAY_REVERSE",
601                Self::ArrayOverlaps => "ARRAY_OVERLAPS",
602                Self::HexToInt256 => "HEX_TO_INT256",
603                Self::JsonbAccess => "JSONB_ACCESS",
604                Self::JsonbAccessStr => "JSONB_ACCESS_STR",
605                Self::JsonbExtractPath => "JSONB_EXTRACT_PATH",
606                Self::JsonbExtractPathVariadic => "JSONB_EXTRACT_PATH_VARIADIC",
607                Self::JsonbExtractPathText => "JSONB_EXTRACT_PATH_TEXT",
608                Self::JsonbExtractPathTextVariadic => "JSONB_EXTRACT_PATH_TEXT_VARIADIC",
609                Self::JsonbTypeof => "JSONB_TYPEOF",
610                Self::JsonbArrayLength => "JSONB_ARRAY_LENGTH",
611                Self::IsJson => "IS_JSON",
612                Self::JsonbConcat => "JSONB_CONCAT",
613                Self::JsonbObject => "JSONB_OBJECT",
614                Self::JsonbPretty => "JSONB_PRETTY",
615                Self::JsonbContains => "JSONB_CONTAINS",
616                Self::JsonbContained => "JSONB_CONTAINED",
617                Self::JsonbExists => "JSONB_EXISTS",
618                Self::JsonbExistsAny => "JSONB_EXISTS_ANY",
619                Self::JsonbExistsAll => "JSONB_EXISTS_ALL",
620                Self::JsonbDeletePath => "JSONB_DELETE_PATH",
621                Self::JsonbStripNulls => "JSONB_STRIP_NULLS",
622                Self::ToJsonb => "TO_JSONB",
623                Self::JsonbBuildArray => "JSONB_BUILD_ARRAY",
624                Self::JsonbBuildArrayVariadic => "JSONB_BUILD_ARRAY_VARIADIC",
625                Self::JsonbBuildObject => "JSONB_BUILD_OBJECT",
626                Self::JsonbBuildObjectVariadic => "JSONB_BUILD_OBJECT_VARIADIC",
627                Self::JsonbPathExists => "JSONB_PATH_EXISTS",
628                Self::JsonbPathMatch => "JSONB_PATH_MATCH",
629                Self::JsonbPathQueryArray => "JSONB_PATH_QUERY_ARRAY",
630                Self::JsonbPathQueryFirst => "JSONB_PATH_QUERY_FIRST",
631                Self::JsonbPopulateRecord => "JSONB_POPULATE_RECORD",
632                Self::JsonbToRecord => "JSONB_TO_RECORD",
633                Self::JsonbSet => "JSONB_SET",
634                Self::JsonbPopulateMap => "JSONB_POPULATE_MAP",
635                Self::JsonbToArray => "JSONB_TO_ARRAY",
636                Self::MapFromEntries => "MAP_FROM_ENTRIES",
637                Self::MapAccess => "MAP_ACCESS",
638                Self::MapKeys => "MAP_KEYS",
639                Self::MapValues => "MAP_VALUES",
640                Self::MapEntries => "MAP_ENTRIES",
641                Self::MapFromKeyValues => "MAP_FROM_KEY_VALUES",
642                Self::MapLength => "MAP_LENGTH",
643                Self::MapContains => "MAP_CONTAINS",
644                Self::MapCat => "MAP_CAT",
645                Self::MapInsert => "MAP_INSERT",
646                Self::MapDelete => "MAP_DELETE",
647                Self::MapFilter => "MAP_FILTER",
648                Self::L2Distance => "L2_DISTANCE",
649                Self::CosineDistance => "COSINE_DISTANCE",
650                Self::L1Distance => "L1_DISTANCE",
651                Self::InnerProduct => "INNER_PRODUCT",
652                Self::VecConcat => "VEC_CONCAT",
653                Self::L2Norm => "L2_NORM",
654                Self::L2Normalize => "L2_NORMALIZE",
655                Self::Subvector => "SUBVECTOR",
656                Self::CompositeCast => "COMPOSITE_CAST",
657                Self::Vnode => "VNODE",
658                Self::TestFeature => "TEST_FEATURE",
659                Self::VnodeUser => "VNODE_USER",
660                Self::License => "LICENSE",
661                Self::Proctime => "PROCTIME",
662                Self::PgSleep => "PG_SLEEP",
663                Self::PgSleepFor => "PG_SLEEP_FOR",
664                Self::PgSleepUntil => "PG_SLEEP_UNTIL",
665                Self::Random => "RANDOM",
666                Self::ClockTimestamp => "CLOCK_TIMESTAMP",
667                Self::GenRandomUuid => "GEN_RANDOM_UUID",
668                Self::CastRegclass => "CAST_REGCLASS",
669                Self::PgGetIndexdef => "PG_GET_INDEXDEF",
670                Self::ColDescription => "COL_DESCRIPTION",
671                Self::PgGetViewdef => "PG_GET_VIEWDEF",
672                Self::PgGetUserbyid => "PG_GET_USERBYID",
673                Self::PgIndexesSize => "PG_INDEXES_SIZE",
674                Self::PgRelationSize => "PG_RELATION_SIZE",
675                Self::PgGetSerialSequence => "PG_GET_SERIAL_SEQUENCE",
676                Self::PgIndexColumnHasProperty => "PG_INDEX_COLUMN_HAS_PROPERTY",
677                Self::HasTablePrivilege => "HAS_TABLE_PRIVILEGE",
678                Self::HasAnyColumnPrivilege => "HAS_ANY_COLUMN_PRIVILEGE",
679                Self::HasSchemaPrivilege => "HAS_SCHEMA_PRIVILEGE",
680                Self::PgIsInRecovery => "PG_IS_IN_RECOVERY",
681                Self::RwRecoveryStatus => "RW_RECOVERY_STATUS",
682                Self::RwEpochToTs => "RW_EPOCH_TO_TS",
683                Self::PgTableIsVisible => "PG_TABLE_IS_VISIBLE",
684                Self::HasFunctionPrivilege => "HAS_FUNCTION_PRIVILEGE",
685                Self::HasDatabasePrivilege => "HAS_DATABASE_PRIVILEGE",
686                Self::RwClusterId => "RW_CLUSTER_ID",
687                Self::RwFragmentVnodes => "RW_FRAGMENT_VNODES",
688                Self::RwActorVnodes => "RW_ACTOR_VNODES",
689                Self::IcebergTransform => "ICEBERG_TRANSFORM",
690                Self::OpenaiEmbedding => "OPENAI_EMBEDDING",
691            }
692        }
693        /// Creates an enum from field names used in the ProtoBuf definition.
694        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
695            match value {
696                "UNSPECIFIED" => Some(Self::Unspecified),
697                "ADD" => Some(Self::Add),
698                "SUBTRACT" => Some(Self::Subtract),
699                "MULTIPLY" => Some(Self::Multiply),
700                "DIVIDE" => Some(Self::Divide),
701                "MODULUS" => Some(Self::Modulus),
702                "EQUAL" => Some(Self::Equal),
703                "NOT_EQUAL" => Some(Self::NotEqual),
704                "LESS_THAN" => Some(Self::LessThan),
705                "LESS_THAN_OR_EQUAL" => Some(Self::LessThanOrEqual),
706                "GREATER_THAN" => Some(Self::GreaterThan),
707                "GREATER_THAN_OR_EQUAL" => Some(Self::GreaterThanOrEqual),
708                "GREATEST" => Some(Self::Greatest),
709                "LEAST" => Some(Self::Least),
710                "AND" => Some(Self::And),
711                "OR" => Some(Self::Or),
712                "NOT" => Some(Self::Not),
713                "IN" => Some(Self::In),
714                "SOME" => Some(Self::Some),
715                "ALL" => Some(Self::All),
716                "BITWISE_AND" => Some(Self::BitwiseAnd),
717                "BITWISE_OR" => Some(Self::BitwiseOr),
718                "BITWISE_XOR" => Some(Self::BitwiseXor),
719                "BITWISE_NOT" => Some(Self::BitwiseNot),
720                "BITWISE_SHIFT_LEFT" => Some(Self::BitwiseShiftLeft),
721                "BITWISE_SHIFT_RIGHT" => Some(Self::BitwiseShiftRight),
722                "EXTRACT" => Some(Self::Extract),
723                "DATE_PART" => Some(Self::DatePart),
724                "TUMBLE_START" => Some(Self::TumbleStart),
725                "MAKE_DATE" => Some(Self::MakeDate),
726                "MAKE_TIME" => Some(Self::MakeTime),
727                "MAKE_TIMESTAMP" => Some(Self::MakeTimestamp),
728                "DATE_BIN" => Some(Self::DateBin),
729                "SEC_TO_TIMESTAMPTZ" => Some(Self::SecToTimestamptz),
730                "AT_TIME_ZONE" => Some(Self::AtTimeZone),
731                "DATE_TRUNC" => Some(Self::DateTrunc),
732                "CHAR_TO_TIMESTAMPTZ" => Some(Self::CharToTimestamptz),
733                "CHAR_TO_DATE" => Some(Self::CharToDate),
734                "CAST_WITH_TIME_ZONE" => Some(Self::CastWithTimeZone),
735                "ADD_WITH_TIME_ZONE" => Some(Self::AddWithTimeZone),
736                "SUBTRACT_WITH_TIME_ZONE" => Some(Self::SubtractWithTimeZone),
737                "MAKE_TIMESTAMPTZ" => Some(Self::MakeTimestamptz),
738                "CAST" => Some(Self::Cast),
739                "SUBSTR" => Some(Self::Substr),
740                "LENGTH" => Some(Self::Length),
741                "LIKE" => Some(Self::Like),
742                "I_LIKE" => Some(Self::ILike),
743                "SIMILAR_TO_ESCAPE" => Some(Self::SimilarToEscape),
744                "UPPER" => Some(Self::Upper),
745                "LOWER" => Some(Self::Lower),
746                "TRIM" => Some(Self::Trim),
747                "REPLACE" => Some(Self::Replace),
748                "POSITION" => Some(Self::Position),
749                "LTRIM" => Some(Self::Ltrim),
750                "RTRIM" => Some(Self::Rtrim),
751                "CASE" => Some(Self::Case),
752                "CONSTANT_LOOKUP" => Some(Self::ConstantLookup),
753                "ROUND_DIGIT" => Some(Self::RoundDigit),
754                "ROUND" => Some(Self::Round),
755                "ASCII" => Some(Self::Ascii),
756                "TRANSLATE" => Some(Self::Translate),
757                "COALESCE" => Some(Self::Coalesce),
758                "CONCAT_WS" => Some(Self::ConcatWs),
759                "CONCAT_WS_VARIADIC" => Some(Self::ConcatWsVariadic),
760                "ABS" => Some(Self::Abs),
761                "SPLIT_PART" => Some(Self::SplitPart),
762                "CEIL" => Some(Self::Ceil),
763                "FLOOR" => Some(Self::Floor),
764                "TO_CHAR" => Some(Self::ToChar),
765                "MD5" => Some(Self::Md5),
766                "CHAR_LENGTH" => Some(Self::CharLength),
767                "REPEAT" => Some(Self::Repeat),
768                "CONCAT_OP" => Some(Self::ConcatOp),
769                "BYTEA_CONCAT_OP" => Some(Self::ByteaConcatOp),
770                "CONCAT" => Some(Self::Concat),
771                "CONCAT_VARIADIC" => Some(Self::ConcatVariadic),
772                "BOOL_OUT" => Some(Self::BoolOut),
773                "OCTET_LENGTH" => Some(Self::OctetLength),
774                "BIT_LENGTH" => Some(Self::BitLength),
775                "OVERLAY" => Some(Self::Overlay),
776                "REGEXP_MATCH" => Some(Self::RegexpMatch),
777                "REGEXP_REPLACE" => Some(Self::RegexpReplace),
778                "REGEXP_COUNT" => Some(Self::RegexpCount),
779                "REGEXP_SPLIT_TO_ARRAY" => Some(Self::RegexpSplitToArray),
780                "REGEXP_EQ" => Some(Self::RegexpEq),
781                "POW" => Some(Self::Pow),
782                "EXP" => Some(Self::Exp),
783                "CHR" => Some(Self::Chr),
784                "STARTS_WITH" => Some(Self::StartsWith),
785                "INITCAP" => Some(Self::Initcap),
786                "LPAD" => Some(Self::Lpad),
787                "RPAD" => Some(Self::Rpad),
788                "REVERSE" => Some(Self::Reverse),
789                "STRPOS" => Some(#[allow(deprecated)] Self::Strpos),
790                "TO_ASCII" => Some(Self::ToAscii),
791                "TO_HEX" => Some(Self::ToHex),
792                "QUOTE_IDENT" => Some(Self::QuoteIdent),
793                "SIN" => Some(Self::Sin),
794                "COS" => Some(Self::Cos),
795                "TAN" => Some(Self::Tan),
796                "COT" => Some(Self::Cot),
797                "ASIN" => Some(Self::Asin),
798                "ACOS" => Some(Self::Acos),
799                "ATAN" => Some(Self::Atan),
800                "ATAN2" => Some(Self::Atan2),
801                "SIND" => Some(Self::Sind),
802                "COSD" => Some(Self::Cosd),
803                "COTD" => Some(Self::Cotd),
804                "TAND" => Some(Self::Tand),
805                "ASIND" => Some(Self::Asind),
806                "SQRT" => Some(Self::Sqrt),
807                "DEGREES" => Some(Self::Degrees),
808                "RADIANS" => Some(Self::Radians),
809                "COSH" => Some(Self::Cosh),
810                "TANH" => Some(Self::Tanh),
811                "COTH" => Some(Self::Coth),
812                "ASINH" => Some(Self::Asinh),
813                "ACOSH" => Some(Self::Acosh),
814                "ATANH" => Some(Self::Atanh),
815                "SINH" => Some(Self::Sinh),
816                "ACOSD" => Some(Self::Acosd),
817                "ATAND" => Some(Self::Atand),
818                "ATAN2D" => Some(Self::Atan2d),
819                "TRUNC" => Some(Self::Trunc),
820                "LN" => Some(Self::Ln),
821                "LOG10" => Some(Self::Log10),
822                "CBRT" => Some(Self::Cbrt),
823                "SIGN" => Some(Self::Sign),
824                "SCALE" => Some(Self::Scale),
825                "MIN_SCALE" => Some(Self::MinScale),
826                "TRIM_SCALE" => Some(Self::TrimScale),
827                "GAMMA" => Some(Self::Gamma),
828                "LGAMMA" => Some(Self::Lgamma),
829                "IS_TRUE" => Some(Self::IsTrue),
830                "IS_NOT_TRUE" => Some(Self::IsNotTrue),
831                "IS_FALSE" => Some(Self::IsFalse),
832                "IS_NOT_FALSE" => Some(Self::IsNotFalse),
833                "IS_NULL" => Some(Self::IsNull),
834                "IS_NOT_NULL" => Some(Self::IsNotNull),
835                "IS_DISTINCT_FROM" => Some(Self::IsDistinctFrom),
836                "IS_NOT_DISTINCT_FROM" => Some(Self::IsNotDistinctFrom),
837                "ENCODE" => Some(Self::Encode),
838                "DECODE" => Some(Self::Decode),
839                "SHA1" => Some(Self::Sha1),
840                "SHA224" => Some(Self::Sha224),
841                "SHA256" => Some(Self::Sha256),
842                "SHA384" => Some(Self::Sha384),
843                "SHA512" => Some(Self::Sha512),
844                "LEFT" => Some(Self::Left),
845                "RIGHT" => Some(Self::Right),
846                "FORMAT" => Some(Self::Format),
847                "FORMAT_VARIADIC" => Some(Self::FormatVariadic),
848                "PGWIRE_SEND" => Some(Self::PgwireSend),
849                "PGWIRE_RECV" => Some(Self::PgwireRecv),
850                "CONVERT_FROM" => Some(Self::ConvertFrom),
851                "CONVERT_TO" => Some(Self::ConvertTo),
852                "DECRYPT" => Some(Self::Decrypt),
853                "ENCRYPT" => Some(Self::Encrypt),
854                "INET_ATON" => Some(Self::InetAton),
855                "INET_NTOA" => Some(Self::InetNtoa),
856                "QUOTE_LITERAL" => Some(Self::QuoteLiteral),
857                "QUOTE_NULLABLE" => Some(Self::QuoteNullable),
858                "HMAC" => Some(Self::Hmac),
859                "SECURE_COMPARE" => Some(Self::SecureCompare),
860                "GET_BIT" => Some(Self::GetBit),
861                "GET_BYTE" => Some(Self::GetByte),
862                "SET_BIT" => Some(Self::SetBit),
863                "SET_BYTE" => Some(Self::SetByte),
864                "BIT_COUNT" => Some(Self::BitCount),
865                "CRC32" => Some(Self::Crc32),
866                "CRC32C" => Some(Self::Crc32c),
867                "CHECK_NOT_NULL" => Some(Self::CheckNotNull),
868                "NEG" => Some(Self::Neg),
869                "FIELD" => Some(Self::Field),
870                "ARRAY" => Some(Self::Array),
871                "ARRAY_ACCESS" => Some(Self::ArrayAccess),
872                "ROW" => Some(Self::Row),
873                "ARRAY_TO_STRING" => Some(Self::ArrayToString),
874                "ARRAY_RANGE_ACCESS" => Some(Self::ArrayRangeAccess),
875                "ARRAY_CAT" => Some(Self::ArrayCat),
876                "ARRAY_APPEND" => Some(Self::ArrayAppend),
877                "ARRAY_PREPEND" => Some(Self::ArrayPrepend),
878                "FORMAT_TYPE" => Some(Self::FormatType),
879                "ARRAY_DISTINCT" => Some(Self::ArrayDistinct),
880                "ARRAY_LENGTH" => Some(Self::ArrayLength),
881                "CARDINALITY" => Some(Self::Cardinality),
882                "ARRAY_REMOVE" => Some(Self::ArrayRemove),
883                "ARRAY_POSITIONS" => Some(Self::ArrayPositions),
884                "TRIM_ARRAY" => Some(Self::TrimArray),
885                "STRING_TO_ARRAY" => Some(Self::StringToArray),
886                "ARRAY_POSITION" => Some(Self::ArrayPosition),
887                "ARRAY_REPLACE" => Some(Self::ArrayReplace),
888                "ARRAY_DIMS" => Some(Self::ArrayDims),
889                "ARRAY_TRANSFORM" => Some(Self::ArrayTransform),
890                "ARRAY_MIN" => Some(Self::ArrayMin),
891                "ARRAY_MAX" => Some(Self::ArrayMax),
892                "ARRAY_SUM" => Some(Self::ArraySum),
893                "ARRAY_SORT" => Some(Self::ArraySort),
894                "ARRAY_CONTAINS" => Some(Self::ArrayContains),
895                "ARRAY_CONTAINED" => Some(Self::ArrayContained),
896                "ARRAY_FLATTEN" => Some(Self::ArrayFlatten),
897                "ARRAY_REVERSE" => Some(Self::ArrayReverse),
898                "ARRAY_OVERLAPS" => Some(Self::ArrayOverlaps),
899                "HEX_TO_INT256" => Some(Self::HexToInt256),
900                "JSONB_ACCESS" => Some(Self::JsonbAccess),
901                "JSONB_ACCESS_STR" => Some(Self::JsonbAccessStr),
902                "JSONB_EXTRACT_PATH" => Some(Self::JsonbExtractPath),
903                "JSONB_EXTRACT_PATH_VARIADIC" => Some(Self::JsonbExtractPathVariadic),
904                "JSONB_EXTRACT_PATH_TEXT" => Some(Self::JsonbExtractPathText),
905                "JSONB_EXTRACT_PATH_TEXT_VARIADIC" => {
906                    Some(Self::JsonbExtractPathTextVariadic)
907                }
908                "JSONB_TYPEOF" => Some(Self::JsonbTypeof),
909                "JSONB_ARRAY_LENGTH" => Some(Self::JsonbArrayLength),
910                "IS_JSON" => Some(Self::IsJson),
911                "JSONB_CONCAT" => Some(Self::JsonbConcat),
912                "JSONB_OBJECT" => Some(Self::JsonbObject),
913                "JSONB_PRETTY" => Some(Self::JsonbPretty),
914                "JSONB_CONTAINS" => Some(Self::JsonbContains),
915                "JSONB_CONTAINED" => Some(Self::JsonbContained),
916                "JSONB_EXISTS" => Some(Self::JsonbExists),
917                "JSONB_EXISTS_ANY" => Some(Self::JsonbExistsAny),
918                "JSONB_EXISTS_ALL" => Some(Self::JsonbExistsAll),
919                "JSONB_DELETE_PATH" => Some(Self::JsonbDeletePath),
920                "JSONB_STRIP_NULLS" => Some(Self::JsonbStripNulls),
921                "TO_JSONB" => Some(Self::ToJsonb),
922                "JSONB_BUILD_ARRAY" => Some(Self::JsonbBuildArray),
923                "JSONB_BUILD_ARRAY_VARIADIC" => Some(Self::JsonbBuildArrayVariadic),
924                "JSONB_BUILD_OBJECT" => Some(Self::JsonbBuildObject),
925                "JSONB_BUILD_OBJECT_VARIADIC" => Some(Self::JsonbBuildObjectVariadic),
926                "JSONB_PATH_EXISTS" => Some(Self::JsonbPathExists),
927                "JSONB_PATH_MATCH" => Some(Self::JsonbPathMatch),
928                "JSONB_PATH_QUERY_ARRAY" => Some(Self::JsonbPathQueryArray),
929                "JSONB_PATH_QUERY_FIRST" => Some(Self::JsonbPathQueryFirst),
930                "JSONB_POPULATE_RECORD" => Some(Self::JsonbPopulateRecord),
931                "JSONB_TO_RECORD" => Some(Self::JsonbToRecord),
932                "JSONB_SET" => Some(Self::JsonbSet),
933                "JSONB_POPULATE_MAP" => Some(Self::JsonbPopulateMap),
934                "JSONB_TO_ARRAY" => Some(Self::JsonbToArray),
935                "MAP_FROM_ENTRIES" => Some(Self::MapFromEntries),
936                "MAP_ACCESS" => Some(Self::MapAccess),
937                "MAP_KEYS" => Some(Self::MapKeys),
938                "MAP_VALUES" => Some(Self::MapValues),
939                "MAP_ENTRIES" => Some(Self::MapEntries),
940                "MAP_FROM_KEY_VALUES" => Some(Self::MapFromKeyValues),
941                "MAP_LENGTH" => Some(Self::MapLength),
942                "MAP_CONTAINS" => Some(Self::MapContains),
943                "MAP_CAT" => Some(Self::MapCat),
944                "MAP_INSERT" => Some(Self::MapInsert),
945                "MAP_DELETE" => Some(Self::MapDelete),
946                "MAP_FILTER" => Some(Self::MapFilter),
947                "L2_DISTANCE" => Some(Self::L2Distance),
948                "COSINE_DISTANCE" => Some(Self::CosineDistance),
949                "L1_DISTANCE" => Some(Self::L1Distance),
950                "INNER_PRODUCT" => Some(Self::InnerProduct),
951                "VEC_CONCAT" => Some(Self::VecConcat),
952                "L2_NORM" => Some(Self::L2Norm),
953                "L2_NORMALIZE" => Some(Self::L2Normalize),
954                "SUBVECTOR" => Some(Self::Subvector),
955                "COMPOSITE_CAST" => Some(Self::CompositeCast),
956                "VNODE" => Some(Self::Vnode),
957                "TEST_FEATURE" => Some(Self::TestFeature),
958                "VNODE_USER" => Some(Self::VnodeUser),
959                "LICENSE" => Some(Self::License),
960                "PROCTIME" => Some(Self::Proctime),
961                "PG_SLEEP" => Some(Self::PgSleep),
962                "PG_SLEEP_FOR" => Some(Self::PgSleepFor),
963                "PG_SLEEP_UNTIL" => Some(Self::PgSleepUntil),
964                "RANDOM" => Some(Self::Random),
965                "CLOCK_TIMESTAMP" => Some(Self::ClockTimestamp),
966                "GEN_RANDOM_UUID" => Some(Self::GenRandomUuid),
967                "CAST_REGCLASS" => Some(Self::CastRegclass),
968                "PG_GET_INDEXDEF" => Some(Self::PgGetIndexdef),
969                "COL_DESCRIPTION" => Some(Self::ColDescription),
970                "PG_GET_VIEWDEF" => Some(Self::PgGetViewdef),
971                "PG_GET_USERBYID" => Some(Self::PgGetUserbyid),
972                "PG_INDEXES_SIZE" => Some(Self::PgIndexesSize),
973                "PG_RELATION_SIZE" => Some(Self::PgRelationSize),
974                "PG_GET_SERIAL_SEQUENCE" => Some(Self::PgGetSerialSequence),
975                "PG_INDEX_COLUMN_HAS_PROPERTY" => Some(Self::PgIndexColumnHasProperty),
976                "HAS_TABLE_PRIVILEGE" => Some(Self::HasTablePrivilege),
977                "HAS_ANY_COLUMN_PRIVILEGE" => Some(Self::HasAnyColumnPrivilege),
978                "HAS_SCHEMA_PRIVILEGE" => Some(Self::HasSchemaPrivilege),
979                "PG_IS_IN_RECOVERY" => Some(Self::PgIsInRecovery),
980                "RW_RECOVERY_STATUS" => Some(Self::RwRecoveryStatus),
981                "RW_EPOCH_TO_TS" => Some(Self::RwEpochToTs),
982                "PG_TABLE_IS_VISIBLE" => Some(Self::PgTableIsVisible),
983                "HAS_FUNCTION_PRIVILEGE" => Some(Self::HasFunctionPrivilege),
984                "HAS_DATABASE_PRIVILEGE" => Some(Self::HasDatabasePrivilege),
985                "RW_CLUSTER_ID" => Some(Self::RwClusterId),
986                "RW_FRAGMENT_VNODES" => Some(Self::RwFragmentVnodes),
987                "RW_ACTOR_VNODES" => Some(Self::RwActorVnodes),
988                "ICEBERG_TRANSFORM" => Some(Self::IcebergTransform),
989                "OPENAI_EMBEDDING" => Some(Self::OpenaiEmbedding),
990                _ => None,
991            }
992        }
993    }
994    #[derive(prost_helpers::AnyPB)]
995    #[derive(::enum_as_inner::EnumAsInner)]
996    #[derive(Eq, Hash)]
997    #[derive(Clone, PartialEq, ::prost::Oneof)]
998    pub enum RexNode {
999        #[prost(uint32, tag = "4")]
1000        InputRef(u32),
1001        #[prost(message, tag = "5")]
1002        Constant(super::super::data::Datum),
1003        #[prost(message, tag = "6")]
1004        FuncCall(super::FunctionCall),
1005        #[prost(message, tag = "7")]
1006        Udf(::prost::alloc::boxed::Box<super::UserDefinedFunction>),
1007        #[prost(message, tag = "8")]
1008        Now(NowRexNode),
1009        #[prost(message, tag = "9")]
1010        SecretRef(super::SecretRefNode),
1011    }
1012}
1013#[derive(prost_helpers::AnyPB)]
1014#[derive(Clone, PartialEq, ::prost::Message)]
1015pub struct TableFunction {
1016    #[prost(enumeration = "table_function::Type", tag = "1")]
1017    pub function_type: i32,
1018    #[prost(message, repeated, tag = "2")]
1019    pub args: ::prost::alloc::vec::Vec<ExprNode>,
1020    #[prost(message, optional, tag = "3")]
1021    pub return_type: ::core::option::Option<super::data::DataType>,
1022    /// optional. only used when the type is USER_DEFINED.
1023    #[prost(message, optional, tag = "4")]
1024    pub udf: ::core::option::Option<UserDefinedFunctionMetadata>,
1025}
1026/// Nested message and enum types in `TableFunction`.
1027pub mod table_function {
1028    #[derive(prost_helpers::AnyPB)]
1029    #[derive(
1030        Clone,
1031        Copy,
1032        Debug,
1033        PartialEq,
1034        Eq,
1035        Hash,
1036        PartialOrd,
1037        Ord,
1038        ::prost::Enumeration
1039    )]
1040    #[repr(i32)]
1041    pub enum Type {
1042        Unspecified = 0,
1043        GenerateSeries = 1,
1044        Unnest = 2,
1045        RegexpMatches = 3,
1046        Range = 4,
1047        GenerateSubscripts = 5,
1048        /// buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE
1049        PgExpandarray = 6,
1050        PgGetKeywords = 18,
1051        /// Jsonb functions
1052        JsonbArrayElements = 10,
1053        JsonbArrayElementsText = 11,
1054        JsonbEach = 12,
1055        JsonbEachText = 13,
1056        JsonbObjectKeys = 14,
1057        JsonbPathQuery = 15,
1058        JsonbPopulateRecordset = 16,
1059        JsonbToRecordset = 17,
1060        /// file scan
1061        FileScan = 19,
1062        /// postgres query
1063        PostgresQuery = 20,
1064        /// mysql query
1065        MysqlQuery = 21,
1066        /// Internal backfill table function
1067        InternalBackfillProgress = 30,
1068        /// Internal source backfill table function
1069        InternalSourceBackfillProgress = 31,
1070        /// Internal channel delta stats table function
1071        InternalGetChannelDeltaStats = 32,
1072        /// User defined table function
1073        UserDefined = 100,
1074    }
1075    impl Type {
1076        /// String value of the enum field names used in the ProtoBuf definition.
1077        ///
1078        /// The values are not transformed in any way and thus are considered stable
1079        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1080        pub fn as_str_name(&self) -> &'static str {
1081            match self {
1082                Self::Unspecified => "UNSPECIFIED",
1083                Self::GenerateSeries => "GENERATE_SERIES",
1084                Self::Unnest => "UNNEST",
1085                Self::RegexpMatches => "REGEXP_MATCHES",
1086                Self::Range => "RANGE",
1087                Self::GenerateSubscripts => "GENERATE_SUBSCRIPTS",
1088                Self::PgExpandarray => "_PG_EXPANDARRAY",
1089                Self::PgGetKeywords => "PG_GET_KEYWORDS",
1090                Self::JsonbArrayElements => "JSONB_ARRAY_ELEMENTS",
1091                Self::JsonbArrayElementsText => "JSONB_ARRAY_ELEMENTS_TEXT",
1092                Self::JsonbEach => "JSONB_EACH",
1093                Self::JsonbEachText => "JSONB_EACH_TEXT",
1094                Self::JsonbObjectKeys => "JSONB_OBJECT_KEYS",
1095                Self::JsonbPathQuery => "JSONB_PATH_QUERY",
1096                Self::JsonbPopulateRecordset => "JSONB_POPULATE_RECORDSET",
1097                Self::JsonbToRecordset => "JSONB_TO_RECORDSET",
1098                Self::FileScan => "FILE_SCAN",
1099                Self::PostgresQuery => "POSTGRES_QUERY",
1100                Self::MysqlQuery => "MYSQL_QUERY",
1101                Self::InternalBackfillProgress => "INTERNAL_BACKFILL_PROGRESS",
1102                Self::InternalSourceBackfillProgress => {
1103                    "INTERNAL_SOURCE_BACKFILL_PROGRESS"
1104                }
1105                Self::InternalGetChannelDeltaStats => "INTERNAL_GET_CHANNEL_DELTA_STATS",
1106                Self::UserDefined => "USER_DEFINED",
1107            }
1108        }
1109        /// Creates an enum from field names used in the ProtoBuf definition.
1110        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1111            match value {
1112                "UNSPECIFIED" => Some(Self::Unspecified),
1113                "GENERATE_SERIES" => Some(Self::GenerateSeries),
1114                "UNNEST" => Some(Self::Unnest),
1115                "REGEXP_MATCHES" => Some(Self::RegexpMatches),
1116                "RANGE" => Some(Self::Range),
1117                "GENERATE_SUBSCRIPTS" => Some(Self::GenerateSubscripts),
1118                "_PG_EXPANDARRAY" => Some(Self::PgExpandarray),
1119                "PG_GET_KEYWORDS" => Some(Self::PgGetKeywords),
1120                "JSONB_ARRAY_ELEMENTS" => Some(Self::JsonbArrayElements),
1121                "JSONB_ARRAY_ELEMENTS_TEXT" => Some(Self::JsonbArrayElementsText),
1122                "JSONB_EACH" => Some(Self::JsonbEach),
1123                "JSONB_EACH_TEXT" => Some(Self::JsonbEachText),
1124                "JSONB_OBJECT_KEYS" => Some(Self::JsonbObjectKeys),
1125                "JSONB_PATH_QUERY" => Some(Self::JsonbPathQuery),
1126                "JSONB_POPULATE_RECORDSET" => Some(Self::JsonbPopulateRecordset),
1127                "JSONB_TO_RECORDSET" => Some(Self::JsonbToRecordset),
1128                "FILE_SCAN" => Some(Self::FileScan),
1129                "POSTGRES_QUERY" => Some(Self::PostgresQuery),
1130                "MYSQL_QUERY" => Some(Self::MysqlQuery),
1131                "INTERNAL_BACKFILL_PROGRESS" => Some(Self::InternalBackfillProgress),
1132                "INTERNAL_SOURCE_BACKFILL_PROGRESS" => {
1133                    Some(Self::InternalSourceBackfillProgress)
1134                }
1135                "INTERNAL_GET_CHANNEL_DELTA_STATS" => {
1136                    Some(Self::InternalGetChannelDeltaStats)
1137                }
1138                "USER_DEFINED" => Some(Self::UserDefined),
1139                _ => None,
1140            }
1141        }
1142    }
1143}
1144/// Reference to an upstream column, containing its index and data type.
1145#[derive(prost_helpers::AnyPB)]
1146#[derive(Eq, Hash)]
1147#[derive(Clone, PartialEq, ::prost::Message)]
1148pub struct InputRef {
1149    #[prost(uint32, tag = "1")]
1150    pub index: u32,
1151    #[prost(message, optional, tag = "2")]
1152    pub r#type: ::core::option::Option<super::data::DataType>,
1153}
1154#[derive(prost_helpers::AnyPB)]
1155#[derive(Clone, PartialEq, ::prost::Message)]
1156pub struct Constant {
1157    #[prost(message, optional, tag = "1")]
1158    pub datum: ::core::option::Option<super::data::Datum>,
1159    #[prost(message, optional, tag = "2")]
1160    pub r#type: ::core::option::Option<super::data::DataType>,
1161}
1162/// The items which can occur in the select list of `ProjectSet` operator.
1163///
1164/// When there are table functions in the SQL query `SELECT ...`, it will be planned as `ProjectSet`.
1165/// Otherwise it will be planned as `Project`.
1166///
1167/// # Examples
1168///
1169/// ```text,sql
1170/// # Project
1171/// select 1;
1172///
1173/// # ProjectSet
1174/// select unnest(array\[1,2,3\]);
1175///
1176/// # ProjectSet (table function & usual expression)
1177/// select unnest(array\[1,2,3\]), 1;
1178///
1179/// # ProjectSet (multiple table functions)
1180/// select unnest(array\[1,2,3\]), unnest(array\[4,5\]);
1181///
1182/// # ProjectSet over ProjectSet (table function as parameters of table function)
1183/// select unnest(regexp_matches(v1, 'a(\d)c(\d)', 'g')) from t;
1184///
1185/// # Project over ProjectSet (table function as parameters of usual function)
1186/// select unnest(regexp_matches(v1, 'a(\d)c(\d)', 'g')) from t;
1187/// ```
1188#[derive(prost_helpers::AnyPB)]
1189#[derive(Clone, PartialEq, ::prost::Message)]
1190pub struct ProjectSetSelectItem {
1191    #[prost(oneof = "project_set_select_item::SelectItem", tags = "1, 2")]
1192    pub select_item: ::core::option::Option<project_set_select_item::SelectItem>,
1193}
1194/// Nested message and enum types in `ProjectSetSelectItem`.
1195pub mod project_set_select_item {
1196    #[derive(prost_helpers::AnyPB)]
1197    #[derive(Clone, PartialEq, ::prost::Oneof)]
1198    pub enum SelectItem {
1199        #[prost(message, tag = "1")]
1200        Expr(super::ExprNode),
1201        #[prost(message, tag = "2")]
1202        TableFunction(super::TableFunction),
1203    }
1204}
1205#[derive(prost_helpers::AnyPB)]
1206#[derive(Eq, Hash)]
1207#[derive(Clone, PartialEq, ::prost::Message)]
1208pub struct FunctionCall {
1209    #[prost(message, repeated, tag = "1")]
1210    pub children: ::prost::alloc::vec::Vec<ExprNode>,
1211}
1212/// Aggregate Function Calls for Aggregation
1213#[derive(prost_helpers::AnyPB)]
1214#[derive(Clone, PartialEq, ::prost::Message)]
1215pub struct AggCall {
1216    #[prost(enumeration = "agg_call::Kind", tag = "1")]
1217    pub kind: i32,
1218    #[prost(message, repeated, tag = "2")]
1219    pub args: ::prost::alloc::vec::Vec<InputRef>,
1220    #[prost(message, optional, tag = "3")]
1221    pub return_type: ::core::option::Option<super::data::DataType>,
1222    #[prost(bool, tag = "4")]
1223    pub distinct: bool,
1224    #[prost(message, repeated, tag = "5")]
1225    pub order_by: ::prost::alloc::vec::Vec<super::common::ColumnOrder>,
1226    #[prost(message, optional, tag = "6")]
1227    pub filter: ::core::option::Option<ExprNode>,
1228    #[prost(message, repeated, tag = "7")]
1229    pub direct_args: ::prost::alloc::vec::Vec<Constant>,
1230    /// optional. only used when the kind is USER_DEFINED.
1231    #[prost(message, optional, tag = "8")]
1232    pub udf: ::core::option::Option<UserDefinedFunctionMetadata>,
1233    /// optional. only used when the kind is WRAP_SCALAR.
1234    #[prost(message, optional, tag = "9")]
1235    pub scalar: ::core::option::Option<ExprNode>,
1236}
1237/// Nested message and enum types in `AggCall`.
1238pub mod agg_call {
1239    #[derive(prost_helpers::AnyPB)]
1240    #[derive(
1241        Clone,
1242        Copy,
1243        Debug,
1244        PartialEq,
1245        Eq,
1246        Hash,
1247        PartialOrd,
1248        Ord,
1249        ::prost::Enumeration
1250    )]
1251    #[repr(i32)]
1252    pub enum Kind {
1253        Unspecified = 0,
1254        Sum = 1,
1255        Min = 2,
1256        Max = 3,
1257        Count = 4,
1258        Avg = 5,
1259        StringAgg = 6,
1260        ApproxCountDistinct = 7,
1261        ArrayAgg = 8,
1262        FirstValue = 9,
1263        Sum0 = 10,
1264        VarPop = 11,
1265        VarSamp = 12,
1266        StddevPop = 13,
1267        StddevSamp = 14,
1268        BitAnd = 15,
1269        BitOr = 16,
1270        BitXor = 17,
1271        BoolAnd = 18,
1272        BoolOr = 19,
1273        JsonbAgg = 20,
1274        JsonbObjectAgg = 21,
1275        PercentileCont = 22,
1276        PercentileDisc = 23,
1277        Mode = 24,
1278        LastValue = 25,
1279        Grouping = 26,
1280        InternalLastSeenValue = 27,
1281        ApproxPercentile = 28,
1282        ArgMin = 29,
1283        ArgMax = 30,
1284        /// user defined aggregate function
1285        UserDefined = 100,
1286        /// wraps a scalar function that takes a list as input as an aggregate function.
1287        WrapScalar = 101,
1288    }
1289    impl Kind {
1290        /// String value of the enum field names used in the ProtoBuf definition.
1291        ///
1292        /// The values are not transformed in any way and thus are considered stable
1293        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1294        pub fn as_str_name(&self) -> &'static str {
1295            match self {
1296                Self::Unspecified => "UNSPECIFIED",
1297                Self::Sum => "SUM",
1298                Self::Min => "MIN",
1299                Self::Max => "MAX",
1300                Self::Count => "COUNT",
1301                Self::Avg => "AVG",
1302                Self::StringAgg => "STRING_AGG",
1303                Self::ApproxCountDistinct => "APPROX_COUNT_DISTINCT",
1304                Self::ArrayAgg => "ARRAY_AGG",
1305                Self::FirstValue => "FIRST_VALUE",
1306                Self::Sum0 => "SUM0",
1307                Self::VarPop => "VAR_POP",
1308                Self::VarSamp => "VAR_SAMP",
1309                Self::StddevPop => "STDDEV_POP",
1310                Self::StddevSamp => "STDDEV_SAMP",
1311                Self::BitAnd => "BIT_AND",
1312                Self::BitOr => "BIT_OR",
1313                Self::BitXor => "BIT_XOR",
1314                Self::BoolAnd => "BOOL_AND",
1315                Self::BoolOr => "BOOL_OR",
1316                Self::JsonbAgg => "JSONB_AGG",
1317                Self::JsonbObjectAgg => "JSONB_OBJECT_AGG",
1318                Self::PercentileCont => "PERCENTILE_CONT",
1319                Self::PercentileDisc => "PERCENTILE_DISC",
1320                Self::Mode => "MODE",
1321                Self::LastValue => "LAST_VALUE",
1322                Self::Grouping => "GROUPING",
1323                Self::InternalLastSeenValue => "INTERNAL_LAST_SEEN_VALUE",
1324                Self::ApproxPercentile => "APPROX_PERCENTILE",
1325                Self::ArgMin => "ARG_MIN",
1326                Self::ArgMax => "ARG_MAX",
1327                Self::UserDefined => "USER_DEFINED",
1328                Self::WrapScalar => "WRAP_SCALAR",
1329            }
1330        }
1331        /// Creates an enum from field names used in the ProtoBuf definition.
1332        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1333            match value {
1334                "UNSPECIFIED" => Some(Self::Unspecified),
1335                "SUM" => Some(Self::Sum),
1336                "MIN" => Some(Self::Min),
1337                "MAX" => Some(Self::Max),
1338                "COUNT" => Some(Self::Count),
1339                "AVG" => Some(Self::Avg),
1340                "STRING_AGG" => Some(Self::StringAgg),
1341                "APPROX_COUNT_DISTINCT" => Some(Self::ApproxCountDistinct),
1342                "ARRAY_AGG" => Some(Self::ArrayAgg),
1343                "FIRST_VALUE" => Some(Self::FirstValue),
1344                "SUM0" => Some(Self::Sum0),
1345                "VAR_POP" => Some(Self::VarPop),
1346                "VAR_SAMP" => Some(Self::VarSamp),
1347                "STDDEV_POP" => Some(Self::StddevPop),
1348                "STDDEV_SAMP" => Some(Self::StddevSamp),
1349                "BIT_AND" => Some(Self::BitAnd),
1350                "BIT_OR" => Some(Self::BitOr),
1351                "BIT_XOR" => Some(Self::BitXor),
1352                "BOOL_AND" => Some(Self::BoolAnd),
1353                "BOOL_OR" => Some(Self::BoolOr),
1354                "JSONB_AGG" => Some(Self::JsonbAgg),
1355                "JSONB_OBJECT_AGG" => Some(Self::JsonbObjectAgg),
1356                "PERCENTILE_CONT" => Some(Self::PercentileCont),
1357                "PERCENTILE_DISC" => Some(Self::PercentileDisc),
1358                "MODE" => Some(Self::Mode),
1359                "LAST_VALUE" => Some(Self::LastValue),
1360                "GROUPING" => Some(Self::Grouping),
1361                "INTERNAL_LAST_SEEN_VALUE" => Some(Self::InternalLastSeenValue),
1362                "APPROX_PERCENTILE" => Some(Self::ApproxPercentile),
1363                "ARG_MIN" => Some(Self::ArgMin),
1364                "ARG_MAX" => Some(Self::ArgMax),
1365                "USER_DEFINED" => Some(Self::UserDefined),
1366                "WRAP_SCALAR" => Some(Self::WrapScalar),
1367                _ => None,
1368            }
1369        }
1370    }
1371}
1372/// The aggregation type.
1373///
1374/// Ideally this should be used to encode the Rust `AggCall::agg_type` field, but historically we
1375/// flattened it into multiple fields in proto `AggCall` - `kind` + `udf` + `scalar`. So this
1376/// `AggType` proto type is only used by `WindowFunction` currently.
1377#[derive(prost_helpers::AnyPB)]
1378#[derive(Clone, PartialEq, ::prost::Message)]
1379pub struct AggType {
1380    #[prost(enumeration = "agg_call::Kind", tag = "1")]
1381    pub kind: i32,
1382    /// UDF metadata. Only present when the kind is `USER_DEFINED`.
1383    #[prost(message, optional, tag = "8")]
1384    pub udf_meta: ::core::option::Option<UserDefinedFunctionMetadata>,
1385    /// Wrapped scalar expression. Only present when the kind is `WRAP_SCALAR`.
1386    #[prost(message, optional, tag = "9")]
1387    pub scalar_expr: ::core::option::Option<ExprNode>,
1388}
1389#[derive(prost_helpers::AnyPB)]
1390#[derive(Clone, PartialEq, ::prost::Message)]
1391pub struct WindowFrame {
1392    #[prost(enumeration = "window_frame::Type", tag = "1")]
1393    pub r#type: i32,
1394    /// Deprecated since we introduced `RANGE` frame.
1395    #[deprecated]
1396    #[prost(message, optional, tag = "2")]
1397    pub start: ::core::option::Option<window_frame::Bound>,
1398    /// Deprecated since we introduced `RANGE` frame.
1399    #[deprecated]
1400    #[prost(message, optional, tag = "3")]
1401    pub end: ::core::option::Option<window_frame::Bound>,
1402    #[prost(enumeration = "window_frame::Exclusion", tag = "4")]
1403    pub exclusion: i32,
1404    #[prost(oneof = "window_frame::Bounds", tags = "10, 15, 20")]
1405    pub bounds: ::core::option::Option<window_frame::Bounds>,
1406}
1407/// Nested message and enum types in `WindowFrame`.
1408pub mod window_frame {
1409    /// Deprecated since we introduced `RANGE` frame.
1410    #[derive(prost_helpers::AnyPB)]
1411    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1412    pub struct Bound {
1413        #[prost(enumeration = "BoundType", tag = "1")]
1414        pub r#type: i32,
1415        #[prost(oneof = "bound::Offset", tags = "2, 3")]
1416        pub offset: ::core::option::Option<bound::Offset>,
1417    }
1418    /// Nested message and enum types in `Bound`.
1419    pub mod bound {
1420        #[derive(prost_helpers::AnyPB)]
1421        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1422        pub enum Offset {
1423            #[prost(uint64, tag = "2")]
1424            Integer(u64),
1425            #[prost(message, tag = "3")]
1426            Datum(super::super::super::data::Datum),
1427        }
1428    }
1429    #[derive(prost_helpers::AnyPB)]
1430    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1431    pub struct RowsFrameBounds {
1432        #[prost(message, optional, tag = "1")]
1433        pub start: ::core::option::Option<RowsFrameBound>,
1434        #[prost(message, optional, tag = "2")]
1435        pub end: ::core::option::Option<RowsFrameBound>,
1436    }
1437    #[derive(prost_helpers::AnyPB)]
1438    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1439    pub struct RowsFrameBound {
1440        #[prost(enumeration = "BoundType", tag = "1")]
1441        pub r#type: i32,
1442        #[prost(uint64, optional, tag = "3")]
1443        pub offset: ::core::option::Option<u64>,
1444    }
1445    #[derive(prost_helpers::AnyPB)]
1446    #[derive(Clone, PartialEq, ::prost::Message)]
1447    pub struct RangeFrameBounds {
1448        #[prost(message, optional, tag = "1")]
1449        pub start: ::core::option::Option<RangeFrameBound>,
1450        #[prost(message, optional, tag = "2")]
1451        pub end: ::core::option::Option<RangeFrameBound>,
1452        #[prost(message, optional, tag = "10")]
1453        pub order_data_type: ::core::option::Option<super::super::data::DataType>,
1454        #[prost(message, optional, tag = "15")]
1455        pub order_type: ::core::option::Option<super::super::common::OrderType>,
1456        #[prost(message, optional, tag = "20")]
1457        pub offset_data_type: ::core::option::Option<super::super::data::DataType>,
1458    }
1459    #[derive(prost_helpers::AnyPB)]
1460    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1461    pub struct RangeFrameBound {
1462        #[prost(enumeration = "BoundType", tag = "1")]
1463        pub r#type: i32,
1464        #[prost(message, optional, tag = "3")]
1465        pub offset: ::core::option::Option<super::super::data::Datum>,
1466    }
1467    #[derive(prost_helpers::AnyPB)]
1468    #[derive(Clone, PartialEq, ::prost::Message)]
1469    pub struct SessionFrameBounds {
1470        #[prost(message, optional, tag = "1")]
1471        pub gap: ::core::option::Option<super::super::data::Datum>,
1472        #[prost(message, optional, tag = "10")]
1473        pub order_data_type: ::core::option::Option<super::super::data::DataType>,
1474        #[prost(message, optional, tag = "15")]
1475        pub order_type: ::core::option::Option<super::super::common::OrderType>,
1476        #[prost(message, optional, tag = "20")]
1477        pub gap_data_type: ::core::option::Option<super::super::data::DataType>,
1478    }
1479    #[derive(prost_helpers::AnyPB)]
1480    #[derive(
1481        Clone,
1482        Copy,
1483        Debug,
1484        PartialEq,
1485        Eq,
1486        Hash,
1487        PartialOrd,
1488        Ord,
1489        ::prost::Enumeration
1490    )]
1491    #[repr(i32)]
1492    pub enum Type {
1493        Unspecified = 0,
1494        /// Deprecated since we introduced `RANGE` frame.
1495        #[deprecated]
1496        RowsLegacy = 2,
1497        Rows = 5,
1498        Range = 10,
1499        Session = 15,
1500    }
1501    impl Type {
1502        /// String value of the enum field names used in the ProtoBuf definition.
1503        ///
1504        /// The values are not transformed in any way and thus are considered stable
1505        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1506        pub fn as_str_name(&self) -> &'static str {
1507            match self {
1508                Self::Unspecified => "TYPE_UNSPECIFIED",
1509                #[allow(deprecated)]
1510                Self::RowsLegacy => "TYPE_ROWS_LEGACY",
1511                Self::Rows => "TYPE_ROWS",
1512                Self::Range => "TYPE_RANGE",
1513                Self::Session => "TYPE_SESSION",
1514            }
1515        }
1516        /// Creates an enum from field names used in the ProtoBuf definition.
1517        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1518            match value {
1519                "TYPE_UNSPECIFIED" => Some(Self::Unspecified),
1520                "TYPE_ROWS_LEGACY" => Some(#[allow(deprecated)] Self::RowsLegacy),
1521                "TYPE_ROWS" => Some(Self::Rows),
1522                "TYPE_RANGE" => Some(Self::Range),
1523                "TYPE_SESSION" => Some(Self::Session),
1524                _ => None,
1525            }
1526        }
1527    }
1528    #[derive(prost_helpers::AnyPB)]
1529    #[derive(
1530        Clone,
1531        Copy,
1532        Debug,
1533        PartialEq,
1534        Eq,
1535        Hash,
1536        PartialOrd,
1537        Ord,
1538        ::prost::Enumeration
1539    )]
1540    #[repr(i32)]
1541    pub enum BoundType {
1542        Unspecified = 0,
1543        UnboundedPreceding = 1,
1544        Preceding = 2,
1545        CurrentRow = 3,
1546        Following = 4,
1547        UnboundedFollowing = 5,
1548    }
1549    impl BoundType {
1550        /// String value of the enum field names used in the ProtoBuf definition.
1551        ///
1552        /// The values are not transformed in any way and thus are considered stable
1553        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1554        pub fn as_str_name(&self) -> &'static str {
1555            match self {
1556                Self::Unspecified => "BOUND_TYPE_UNSPECIFIED",
1557                Self::UnboundedPreceding => "BOUND_TYPE_UNBOUNDED_PRECEDING",
1558                Self::Preceding => "BOUND_TYPE_PRECEDING",
1559                Self::CurrentRow => "BOUND_TYPE_CURRENT_ROW",
1560                Self::Following => "BOUND_TYPE_FOLLOWING",
1561                Self::UnboundedFollowing => "BOUND_TYPE_UNBOUNDED_FOLLOWING",
1562            }
1563        }
1564        /// Creates an enum from field names used in the ProtoBuf definition.
1565        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1566            match value {
1567                "BOUND_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
1568                "BOUND_TYPE_UNBOUNDED_PRECEDING" => Some(Self::UnboundedPreceding),
1569                "BOUND_TYPE_PRECEDING" => Some(Self::Preceding),
1570                "BOUND_TYPE_CURRENT_ROW" => Some(Self::CurrentRow),
1571                "BOUND_TYPE_FOLLOWING" => Some(Self::Following),
1572                "BOUND_TYPE_UNBOUNDED_FOLLOWING" => Some(Self::UnboundedFollowing),
1573                _ => None,
1574            }
1575        }
1576    }
1577    #[derive(prost_helpers::AnyPB)]
1578    #[derive(
1579        Clone,
1580        Copy,
1581        Debug,
1582        PartialEq,
1583        Eq,
1584        Hash,
1585        PartialOrd,
1586        Ord,
1587        ::prost::Enumeration
1588    )]
1589    #[repr(i32)]
1590    pub enum Exclusion {
1591        Unspecified = 0,
1592        CurrentRow = 1,
1593        /// EXCLUSION_GROUP = 2;
1594        /// EXCLUSION_TIES = 3;
1595        NoOthers = 4,
1596    }
1597    impl Exclusion {
1598        /// String value of the enum field names used in the ProtoBuf definition.
1599        ///
1600        /// The values are not transformed in any way and thus are considered stable
1601        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1602        pub fn as_str_name(&self) -> &'static str {
1603            match self {
1604                Self::Unspecified => "EXCLUSION_UNSPECIFIED",
1605                Self::CurrentRow => "EXCLUSION_CURRENT_ROW",
1606                Self::NoOthers => "EXCLUSION_NO_OTHERS",
1607            }
1608        }
1609        /// Creates an enum from field names used in the ProtoBuf definition.
1610        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1611            match value {
1612                "EXCLUSION_UNSPECIFIED" => Some(Self::Unspecified),
1613                "EXCLUSION_CURRENT_ROW" => Some(Self::CurrentRow),
1614                "EXCLUSION_NO_OTHERS" => Some(Self::NoOthers),
1615                _ => None,
1616            }
1617        }
1618    }
1619    #[derive(prost_helpers::AnyPB)]
1620    #[derive(Clone, PartialEq, ::prost::Oneof)]
1621    pub enum Bounds {
1622        #[prost(message, tag = "10")]
1623        Rows(RowsFrameBounds),
1624        #[prost(message, tag = "15")]
1625        Range(RangeFrameBounds),
1626        #[prost(message, tag = "20")]
1627        Session(SessionFrameBounds),
1628    }
1629}
1630#[derive(prost_helpers::AnyPB)]
1631#[derive(Clone, PartialEq, ::prost::Message)]
1632pub struct WindowFunction {
1633    #[prost(message, repeated, tag = "3")]
1634    pub args: ::prost::alloc::vec::Vec<InputRef>,
1635    #[prost(message, optional, tag = "4")]
1636    pub return_type: ::core::option::Option<super::data::DataType>,
1637    #[prost(message, optional, tag = "5")]
1638    pub frame: ::core::option::Option<WindowFrame>,
1639    #[prost(bool, tag = "6")]
1640    pub ignore_nulls: bool,
1641    #[prost(oneof = "window_function::Type", tags = "1, 2, 103")]
1642    pub r#type: ::core::option::Option<window_function::Type>,
1643}
1644/// Nested message and enum types in `WindowFunction`.
1645pub mod window_function {
1646    #[derive(prost_helpers::AnyPB)]
1647    #[derive(
1648        Clone,
1649        Copy,
1650        Debug,
1651        PartialEq,
1652        Eq,
1653        Hash,
1654        PartialOrd,
1655        Ord,
1656        ::prost::Enumeration
1657    )]
1658    #[repr(i32)]
1659    pub enum GeneralType {
1660        Unspecified = 0,
1661        RowNumber = 1,
1662        Rank = 2,
1663        DenseRank = 3,
1664        /// PERCENT_RANK = 4;
1665        /// CUME_DIST = 5;
1666        /// NTILE = 6;
1667        Lag = 7,
1668        Lead = 8,
1669    }
1670    impl GeneralType {
1671        /// String value of the enum field names used in the ProtoBuf definition.
1672        ///
1673        /// The values are not transformed in any way and thus are considered stable
1674        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1675        pub fn as_str_name(&self) -> &'static str {
1676            match self {
1677                Self::Unspecified => "UNSPECIFIED",
1678                Self::RowNumber => "ROW_NUMBER",
1679                Self::Rank => "RANK",
1680                Self::DenseRank => "DENSE_RANK",
1681                Self::Lag => "LAG",
1682                Self::Lead => "LEAD",
1683            }
1684        }
1685        /// Creates an enum from field names used in the ProtoBuf definition.
1686        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1687            match value {
1688                "UNSPECIFIED" => Some(Self::Unspecified),
1689                "ROW_NUMBER" => Some(Self::RowNumber),
1690                "RANK" => Some(Self::Rank),
1691                "DENSE_RANK" => Some(Self::DenseRank),
1692                "LAG" => Some(Self::Lag),
1693                "LEAD" => Some(Self::Lead),
1694                _ => None,
1695            }
1696        }
1697    }
1698    #[derive(prost_helpers::AnyPB)]
1699    #[derive(Clone, PartialEq, ::prost::Oneof)]
1700    pub enum Type {
1701        #[prost(enumeration = "GeneralType", tag = "1")]
1702        General(i32),
1703        /// Deprecated since we have a new `aggregate2` variant.
1704        #[deprecated]
1705        #[prost(enumeration = "super::agg_call::Kind", tag = "2")]
1706        Aggregate(i32),
1707        #[prost(message, tag = "103")]
1708        Aggregate2(super::AggType),
1709    }
1710}
1711#[derive(prost_helpers::AnyPB)]
1712#[derive(Eq, Hash)]
1713#[derive(Clone, PartialEq, ::prost::Message)]
1714pub struct UserDefinedFunction {
1715    #[prost(message, repeated, tag = "1")]
1716    pub children: ::prost::alloc::vec::Vec<ExprNode>,
1717    #[prost(string, tag = "2")]
1718    pub name: ::prost::alloc::string::String,
1719    #[prost(string, repeated, tag = "8")]
1720    pub arg_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1721    #[prost(message, repeated, tag = "3")]
1722    pub arg_types: ::prost::alloc::vec::Vec<super::data::DataType>,
1723    #[prost(string, tag = "4")]
1724    pub language: ::prost::alloc::string::String,
1725    /// The link to the external function service.
1726    #[prost(string, optional, tag = "5")]
1727    pub link: ::core::option::Option<::prost::alloc::string::String>,
1728    /// This is re-interpreted as `name_in_runtime`.
1729    #[prost(string, optional, tag = "6")]
1730    pub identifier: ::core::option::Option<::prost::alloc::string::String>,
1731    /// * If `language` is `javascript` or `python`, the source code of the function.
1732    #[prost(string, optional, tag = "7")]
1733    pub body: ::core::option::Option<::prost::alloc::string::String>,
1734    /// * If `language` is `rust` or `wasm`, the zstd-compressed wasm binary.
1735    #[prost(bytes = "vec", optional, tag = "10")]
1736    pub compressed_binary: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
1737    #[prost(bool, tag = "9")]
1738    pub always_retry_on_network_error: bool,
1739    /// The runtime selected when multiple runtimes are available for the language. Now is not used.
1740    #[prost(string, optional, tag = "11")]
1741    pub runtime: ::core::option::Option<::prost::alloc::string::String>,
1742    /// additional options for javascript functions
1743    #[prost(bool, optional, tag = "13")]
1744    pub is_async: ::core::option::Option<bool>,
1745    #[prost(bool, optional, tag = "14")]
1746    pub is_batched: ::core::option::Option<bool>,
1747    #[prost(enumeration = "UdfExprVersion", tag = "1000")]
1748    pub version: i32,
1749}
1750/// Additional information for user defined table/aggregate functions.
1751#[derive(prost_helpers::AnyPB)]
1752#[derive(Eq, Hash)]
1753#[derive(Clone, PartialEq, ::prost::Message)]
1754pub struct UserDefinedFunctionMetadata {
1755    #[prost(string, repeated, tag = "8")]
1756    pub arg_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1757    #[prost(message, repeated, tag = "3")]
1758    pub arg_types: ::prost::alloc::vec::Vec<super::data::DataType>,
1759    #[prost(message, optional, tag = "13")]
1760    pub return_type: ::core::option::Option<super::data::DataType>,
1761    #[prost(string, tag = "4")]
1762    pub language: ::prost::alloc::string::String,
1763    #[prost(string, optional, tag = "5")]
1764    pub link: ::core::option::Option<::prost::alloc::string::String>,
1765    /// This is re-interpreted as `name_in_runtime`.
1766    #[prost(string, optional, tag = "6")]
1767    pub identifier: ::core::option::Option<::prost::alloc::string::String>,
1768    #[prost(string, optional, tag = "7")]
1769    pub body: ::core::option::Option<::prost::alloc::string::String>,
1770    #[prost(bytes = "vec", optional, tag = "10")]
1771    pub compressed_binary: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
1772    #[prost(string, optional, tag = "11")]
1773    pub runtime: ::core::option::Option<::prost::alloc::string::String>,
1774    /// additional options for javascript functions
1775    #[prost(bool, optional, tag = "14")]
1776    pub is_async: ::core::option::Option<bool>,
1777    #[prost(bool, optional, tag = "15")]
1778    pub is_batched: ::core::option::Option<bool>,
1779    #[prost(enumeration = "UdfExprVersion", tag = "1000")]
1780    pub version: i32,
1781}
1782#[derive(prost_helpers::AnyPB)]
1783#[derive(prost_helpers::Version)]
1784#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1785#[repr(i32)]
1786pub enum UdfExprVersion {
1787    /// Versions before introducing this enum.
1788    Unspecified = 0,
1789    /// Begin from this version, we re-interpret `identifier` as `name_in_runtime`.
1790    NameInRuntime = 1,
1791}
1792impl UdfExprVersion {
1793    /// String value of the enum field names used in the ProtoBuf definition.
1794    ///
1795    /// The values are not transformed in any way and thus are considered stable
1796    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1797    pub fn as_str_name(&self) -> &'static str {
1798        match self {
1799            Self::Unspecified => "UDF_EXPR_VERSION_UNSPECIFIED",
1800            Self::NameInRuntime => "UDF_EXPR_VERSION_NAME_IN_RUNTIME",
1801        }
1802    }
1803    /// Creates an enum from field names used in the ProtoBuf definition.
1804    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1805        match value {
1806            "UDF_EXPR_VERSION_UNSPECIFIED" => Some(Self::Unspecified),
1807            "UDF_EXPR_VERSION_NAME_IN_RUNTIME" => Some(Self::NameInRuntime),
1808            _ => None,
1809        }
1810    }
1811}