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