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        /// mssql query
1080        MssqlQuery = 22,
1081        /// Internal backfill table function
1082        InternalBackfillProgress = 30,
1083        /// Internal source backfill table function
1084        InternalSourceBackfillProgress = 31,
1085        /// Internal channel delta stats table function
1086        InternalGetChannelDeltaStats = 32,
1087        /// User defined table function
1088        UserDefined = 100,
1089    }
1090    impl Type {
1091        /// String value of the enum field names used in the ProtoBuf definition.
1092        ///
1093        /// The values are not transformed in any way and thus are considered stable
1094        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1095        pub fn as_str_name(&self) -> &'static str {
1096            match self {
1097                Self::Unspecified => "UNSPECIFIED",
1098                Self::GenerateSeries => "GENERATE_SERIES",
1099                Self::Unnest => "UNNEST",
1100                Self::RegexpMatches => "REGEXP_MATCHES",
1101                Self::Range => "RANGE",
1102                Self::GenerateSubscripts => "GENERATE_SUBSCRIPTS",
1103                Self::PgExpandarray => "_PG_EXPANDARRAY",
1104                Self::PgGetKeywords => "PG_GET_KEYWORDS",
1105                Self::JsonbArrayElements => "JSONB_ARRAY_ELEMENTS",
1106                Self::JsonbArrayElementsText => "JSONB_ARRAY_ELEMENTS_TEXT",
1107                Self::JsonbEach => "JSONB_EACH",
1108                Self::JsonbEachText => "JSONB_EACH_TEXT",
1109                Self::JsonbObjectKeys => "JSONB_OBJECT_KEYS",
1110                Self::JsonbPathQuery => "JSONB_PATH_QUERY",
1111                Self::JsonbPopulateRecordset => "JSONB_POPULATE_RECORDSET",
1112                Self::JsonbToRecordset => "JSONB_TO_RECORDSET",
1113                Self::FileScan => "FILE_SCAN",
1114                Self::PostgresQuery => "POSTGRES_QUERY",
1115                Self::MysqlQuery => "MYSQL_QUERY",
1116                Self::MssqlQuery => "MSSQL_QUERY",
1117                Self::InternalBackfillProgress => "INTERNAL_BACKFILL_PROGRESS",
1118                Self::InternalSourceBackfillProgress => {
1119                    "INTERNAL_SOURCE_BACKFILL_PROGRESS"
1120                }
1121                Self::InternalGetChannelDeltaStats => "INTERNAL_GET_CHANNEL_DELTA_STATS",
1122                Self::UserDefined => "USER_DEFINED",
1123            }
1124        }
1125        /// Creates an enum from field names used in the ProtoBuf definition.
1126        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1127            match value {
1128                "UNSPECIFIED" => Some(Self::Unspecified),
1129                "GENERATE_SERIES" => Some(Self::GenerateSeries),
1130                "UNNEST" => Some(Self::Unnest),
1131                "REGEXP_MATCHES" => Some(Self::RegexpMatches),
1132                "RANGE" => Some(Self::Range),
1133                "GENERATE_SUBSCRIPTS" => Some(Self::GenerateSubscripts),
1134                "_PG_EXPANDARRAY" => Some(Self::PgExpandarray),
1135                "PG_GET_KEYWORDS" => Some(Self::PgGetKeywords),
1136                "JSONB_ARRAY_ELEMENTS" => Some(Self::JsonbArrayElements),
1137                "JSONB_ARRAY_ELEMENTS_TEXT" => Some(Self::JsonbArrayElementsText),
1138                "JSONB_EACH" => Some(Self::JsonbEach),
1139                "JSONB_EACH_TEXT" => Some(Self::JsonbEachText),
1140                "JSONB_OBJECT_KEYS" => Some(Self::JsonbObjectKeys),
1141                "JSONB_PATH_QUERY" => Some(Self::JsonbPathQuery),
1142                "JSONB_POPULATE_RECORDSET" => Some(Self::JsonbPopulateRecordset),
1143                "JSONB_TO_RECORDSET" => Some(Self::JsonbToRecordset),
1144                "FILE_SCAN" => Some(Self::FileScan),
1145                "POSTGRES_QUERY" => Some(Self::PostgresQuery),
1146                "MYSQL_QUERY" => Some(Self::MysqlQuery),
1147                "MSSQL_QUERY" => Some(Self::MssqlQuery),
1148                "INTERNAL_BACKFILL_PROGRESS" => Some(Self::InternalBackfillProgress),
1149                "INTERNAL_SOURCE_BACKFILL_PROGRESS" => {
1150                    Some(Self::InternalSourceBackfillProgress)
1151                }
1152                "INTERNAL_GET_CHANNEL_DELTA_STATS" => {
1153                    Some(Self::InternalGetChannelDeltaStats)
1154                }
1155                "USER_DEFINED" => Some(Self::UserDefined),
1156                _ => None,
1157            }
1158        }
1159    }
1160}
1161/// Reference to an upstream column, containing its index and data type.
1162#[derive(prost_helpers::AnyPB)]
1163#[derive(Eq, Hash)]
1164#[derive(Clone, PartialEq, ::prost::Message)]
1165pub struct InputRef {
1166    #[prost(uint32, tag = "1")]
1167    pub index: u32,
1168    #[prost(message, optional, tag = "2")]
1169    pub r#type: ::core::option::Option<super::data::DataType>,
1170}
1171#[derive(prost_helpers::AnyPB)]
1172#[derive(Clone, PartialEq, ::prost::Message)]
1173pub struct Constant {
1174    #[prost(message, optional, tag = "1")]
1175    pub datum: ::core::option::Option<super::data::Datum>,
1176    #[prost(message, optional, tag = "2")]
1177    pub r#type: ::core::option::Option<super::data::DataType>,
1178}
1179/// The items which can occur in the select list of `ProjectSet` operator.
1180///
1181/// When there are table functions in the SQL query `SELECT ...`, it will be planned as `ProjectSet`.
1182/// Otherwise it will be planned as `Project`.
1183///
1184/// # Examples
1185///
1186/// ```text,sql
1187/// # Project
1188/// select 1;
1189///
1190/// # ProjectSet
1191/// select unnest(array\[1,2,3\]);
1192///
1193/// # ProjectSet (table function & usual expression)
1194/// select unnest(array\[1,2,3\]), 1;
1195///
1196/// # ProjectSet (multiple table functions)
1197/// select unnest(array\[1,2,3\]), unnest(array\[4,5\]);
1198///
1199/// # ProjectSet over ProjectSet (table function as parameters of table function)
1200/// select unnest(regexp_matches(v1, 'a(\d)c(\d)', 'g')) from t;
1201///
1202/// # Project over ProjectSet (table function as parameters of usual function)
1203/// select unnest(regexp_matches(v1, 'a(\d)c(\d)', 'g')) from t;
1204/// ```
1205#[derive(prost_helpers::AnyPB)]
1206#[derive(Clone, PartialEq, ::prost::Message)]
1207pub struct ProjectSetSelectItem {
1208    #[prost(oneof = "project_set_select_item::SelectItem", tags = "1, 2")]
1209    pub select_item: ::core::option::Option<project_set_select_item::SelectItem>,
1210}
1211/// Nested message and enum types in `ProjectSetSelectItem`.
1212pub mod project_set_select_item {
1213    #[derive(prost_helpers::AnyPB)]
1214    #[derive(Clone, PartialEq, ::prost::Oneof)]
1215    pub enum SelectItem {
1216        #[prost(message, tag = "1")]
1217        Expr(super::ExprNode),
1218        #[prost(message, tag = "2")]
1219        TableFunction(super::TableFunction),
1220    }
1221}
1222#[derive(prost_helpers::AnyPB)]
1223#[derive(Eq, Hash)]
1224#[derive(Clone, PartialEq, ::prost::Message)]
1225pub struct FunctionCall {
1226    #[prost(message, repeated, tag = "1")]
1227    pub children: ::prost::alloc::vec::Vec<ExprNode>,
1228}
1229/// Aggregate Function Calls for Aggregation
1230#[derive(prost_helpers::AnyPB)]
1231#[derive(Clone, PartialEq, ::prost::Message)]
1232pub struct AggCall {
1233    #[prost(enumeration = "agg_call::Kind", tag = "1")]
1234    pub kind: i32,
1235    #[prost(message, repeated, tag = "2")]
1236    pub args: ::prost::alloc::vec::Vec<InputRef>,
1237    #[prost(message, optional, tag = "3")]
1238    pub return_type: ::core::option::Option<super::data::DataType>,
1239    #[prost(bool, tag = "4")]
1240    pub distinct: bool,
1241    #[prost(message, repeated, tag = "5")]
1242    pub order_by: ::prost::alloc::vec::Vec<super::common::ColumnOrder>,
1243    #[prost(message, optional, tag = "6")]
1244    pub filter: ::core::option::Option<ExprNode>,
1245    #[prost(message, repeated, tag = "7")]
1246    pub direct_args: ::prost::alloc::vec::Vec<Constant>,
1247    /// optional. only used when the kind is USER_DEFINED.
1248    #[prost(message, optional, tag = "8")]
1249    pub udf: ::core::option::Option<UserDefinedFunctionMetadata>,
1250    /// optional. only used when the kind is WRAP_SCALAR.
1251    #[prost(message, optional, tag = "9")]
1252    pub scalar: ::core::option::Option<ExprNode>,
1253}
1254/// Nested message and enum types in `AggCall`.
1255pub mod agg_call {
1256    #[derive(prost_helpers::AnyPB)]
1257    #[derive(
1258        Clone,
1259        Copy,
1260        Debug,
1261        PartialEq,
1262        Eq,
1263        Hash,
1264        PartialOrd,
1265        Ord,
1266        ::prost::Enumeration
1267    )]
1268    #[repr(i32)]
1269    pub enum Kind {
1270        Unspecified = 0,
1271        Sum = 1,
1272        Min = 2,
1273        Max = 3,
1274        Count = 4,
1275        Avg = 5,
1276        StringAgg = 6,
1277        ApproxCountDistinct = 7,
1278        ArrayAgg = 8,
1279        FirstValue = 9,
1280        Sum0 = 10,
1281        VarPop = 11,
1282        VarSamp = 12,
1283        StddevPop = 13,
1284        StddevSamp = 14,
1285        BitAnd = 15,
1286        BitOr = 16,
1287        BitXor = 17,
1288        BoolAnd = 18,
1289        BoolOr = 19,
1290        JsonbAgg = 20,
1291        JsonbObjectAgg = 21,
1292        PercentileCont = 22,
1293        PercentileDisc = 23,
1294        Mode = 24,
1295        LastValue = 25,
1296        Grouping = 26,
1297        InternalLastSeenValue = 27,
1298        ApproxPercentile = 28,
1299        ArgMin = 29,
1300        ArgMax = 30,
1301        /// user defined aggregate function
1302        UserDefined = 100,
1303        /// wraps a scalar function that takes a list as input as an aggregate function.
1304        WrapScalar = 101,
1305    }
1306    impl Kind {
1307        /// String value of the enum field names used in the ProtoBuf definition.
1308        ///
1309        /// The values are not transformed in any way and thus are considered stable
1310        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1311        pub fn as_str_name(&self) -> &'static str {
1312            match self {
1313                Self::Unspecified => "UNSPECIFIED",
1314                Self::Sum => "SUM",
1315                Self::Min => "MIN",
1316                Self::Max => "MAX",
1317                Self::Count => "COUNT",
1318                Self::Avg => "AVG",
1319                Self::StringAgg => "STRING_AGG",
1320                Self::ApproxCountDistinct => "APPROX_COUNT_DISTINCT",
1321                Self::ArrayAgg => "ARRAY_AGG",
1322                Self::FirstValue => "FIRST_VALUE",
1323                Self::Sum0 => "SUM0",
1324                Self::VarPop => "VAR_POP",
1325                Self::VarSamp => "VAR_SAMP",
1326                Self::StddevPop => "STDDEV_POP",
1327                Self::StddevSamp => "STDDEV_SAMP",
1328                Self::BitAnd => "BIT_AND",
1329                Self::BitOr => "BIT_OR",
1330                Self::BitXor => "BIT_XOR",
1331                Self::BoolAnd => "BOOL_AND",
1332                Self::BoolOr => "BOOL_OR",
1333                Self::JsonbAgg => "JSONB_AGG",
1334                Self::JsonbObjectAgg => "JSONB_OBJECT_AGG",
1335                Self::PercentileCont => "PERCENTILE_CONT",
1336                Self::PercentileDisc => "PERCENTILE_DISC",
1337                Self::Mode => "MODE",
1338                Self::LastValue => "LAST_VALUE",
1339                Self::Grouping => "GROUPING",
1340                Self::InternalLastSeenValue => "INTERNAL_LAST_SEEN_VALUE",
1341                Self::ApproxPercentile => "APPROX_PERCENTILE",
1342                Self::ArgMin => "ARG_MIN",
1343                Self::ArgMax => "ARG_MAX",
1344                Self::UserDefined => "USER_DEFINED",
1345                Self::WrapScalar => "WRAP_SCALAR",
1346            }
1347        }
1348        /// Creates an enum from field names used in the ProtoBuf definition.
1349        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1350            match value {
1351                "UNSPECIFIED" => Some(Self::Unspecified),
1352                "SUM" => Some(Self::Sum),
1353                "MIN" => Some(Self::Min),
1354                "MAX" => Some(Self::Max),
1355                "COUNT" => Some(Self::Count),
1356                "AVG" => Some(Self::Avg),
1357                "STRING_AGG" => Some(Self::StringAgg),
1358                "APPROX_COUNT_DISTINCT" => Some(Self::ApproxCountDistinct),
1359                "ARRAY_AGG" => Some(Self::ArrayAgg),
1360                "FIRST_VALUE" => Some(Self::FirstValue),
1361                "SUM0" => Some(Self::Sum0),
1362                "VAR_POP" => Some(Self::VarPop),
1363                "VAR_SAMP" => Some(Self::VarSamp),
1364                "STDDEV_POP" => Some(Self::StddevPop),
1365                "STDDEV_SAMP" => Some(Self::StddevSamp),
1366                "BIT_AND" => Some(Self::BitAnd),
1367                "BIT_OR" => Some(Self::BitOr),
1368                "BIT_XOR" => Some(Self::BitXor),
1369                "BOOL_AND" => Some(Self::BoolAnd),
1370                "BOOL_OR" => Some(Self::BoolOr),
1371                "JSONB_AGG" => Some(Self::JsonbAgg),
1372                "JSONB_OBJECT_AGG" => Some(Self::JsonbObjectAgg),
1373                "PERCENTILE_CONT" => Some(Self::PercentileCont),
1374                "PERCENTILE_DISC" => Some(Self::PercentileDisc),
1375                "MODE" => Some(Self::Mode),
1376                "LAST_VALUE" => Some(Self::LastValue),
1377                "GROUPING" => Some(Self::Grouping),
1378                "INTERNAL_LAST_SEEN_VALUE" => Some(Self::InternalLastSeenValue),
1379                "APPROX_PERCENTILE" => Some(Self::ApproxPercentile),
1380                "ARG_MIN" => Some(Self::ArgMin),
1381                "ARG_MAX" => Some(Self::ArgMax),
1382                "USER_DEFINED" => Some(Self::UserDefined),
1383                "WRAP_SCALAR" => Some(Self::WrapScalar),
1384                _ => None,
1385            }
1386        }
1387    }
1388}
1389/// The aggregation type.
1390///
1391/// Ideally this should be used to encode the Rust `AggCall::agg_type` field, but historically we
1392/// flattened it into multiple fields in proto `AggCall` - `kind` + `udf` + `scalar`. So this
1393/// `AggType` proto type is only used by `WindowFunction` currently.
1394#[derive(prost_helpers::AnyPB)]
1395#[derive(Clone, PartialEq, ::prost::Message)]
1396pub struct AggType {
1397    #[prost(enumeration = "agg_call::Kind", tag = "1")]
1398    pub kind: i32,
1399    /// UDF metadata. Only present when the kind is `USER_DEFINED`.
1400    #[prost(message, optional, tag = "8")]
1401    pub udf_meta: ::core::option::Option<UserDefinedFunctionMetadata>,
1402    /// Wrapped scalar expression. Only present when the kind is `WRAP_SCALAR`.
1403    #[prost(message, optional, tag = "9")]
1404    pub scalar_expr: ::core::option::Option<ExprNode>,
1405}
1406#[derive(prost_helpers::AnyPB)]
1407#[derive(Clone, PartialEq, ::prost::Message)]
1408pub struct WindowFrame {
1409    #[prost(enumeration = "window_frame::Type", tag = "1")]
1410    pub r#type: i32,
1411    /// Deprecated since we introduced `RANGE` frame.
1412    #[deprecated]
1413    #[prost(message, optional, tag = "2")]
1414    pub start: ::core::option::Option<window_frame::Bound>,
1415    /// Deprecated since we introduced `RANGE` frame.
1416    #[deprecated]
1417    #[prost(message, optional, tag = "3")]
1418    pub end: ::core::option::Option<window_frame::Bound>,
1419    #[prost(enumeration = "window_frame::Exclusion", tag = "4")]
1420    pub exclusion: i32,
1421    #[prost(oneof = "window_frame::Bounds", tags = "10, 15, 20")]
1422    pub bounds: ::core::option::Option<window_frame::Bounds>,
1423}
1424/// Nested message and enum types in `WindowFrame`.
1425pub mod window_frame {
1426    /// Deprecated since we introduced `RANGE` frame.
1427    #[derive(prost_helpers::AnyPB)]
1428    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1429    pub struct Bound {
1430        #[prost(enumeration = "BoundType", tag = "1")]
1431        pub r#type: i32,
1432        #[prost(oneof = "bound::Offset", tags = "2, 3")]
1433        pub offset: ::core::option::Option<bound::Offset>,
1434    }
1435    /// Nested message and enum types in `Bound`.
1436    pub mod bound {
1437        #[derive(prost_helpers::AnyPB)]
1438        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1439        pub enum Offset {
1440            #[prost(uint64, tag = "2")]
1441            Integer(u64),
1442            #[prost(message, tag = "3")]
1443            Datum(super::super::super::data::Datum),
1444        }
1445    }
1446    #[derive(prost_helpers::AnyPB)]
1447    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1448    pub struct RowsFrameBounds {
1449        #[prost(message, optional, tag = "1")]
1450        pub start: ::core::option::Option<RowsFrameBound>,
1451        #[prost(message, optional, tag = "2")]
1452        pub end: ::core::option::Option<RowsFrameBound>,
1453    }
1454    #[derive(prost_helpers::AnyPB)]
1455    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1456    pub struct RowsFrameBound {
1457        #[prost(enumeration = "BoundType", tag = "1")]
1458        pub r#type: i32,
1459        #[prost(uint64, optional, tag = "3")]
1460        pub offset: ::core::option::Option<u64>,
1461    }
1462    #[derive(prost_helpers::AnyPB)]
1463    #[derive(Clone, PartialEq, ::prost::Message)]
1464    pub struct RangeFrameBounds {
1465        #[prost(message, optional, tag = "1")]
1466        pub start: ::core::option::Option<RangeFrameBound>,
1467        #[prost(message, optional, tag = "2")]
1468        pub end: ::core::option::Option<RangeFrameBound>,
1469        #[prost(message, optional, tag = "10")]
1470        pub order_data_type: ::core::option::Option<super::super::data::DataType>,
1471        #[prost(message, optional, tag = "15")]
1472        pub order_type: ::core::option::Option<super::super::common::OrderType>,
1473        #[prost(message, optional, tag = "20")]
1474        pub offset_data_type: ::core::option::Option<super::super::data::DataType>,
1475    }
1476    #[derive(prost_helpers::AnyPB)]
1477    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1478    pub struct RangeFrameBound {
1479        #[prost(enumeration = "BoundType", tag = "1")]
1480        pub r#type: i32,
1481        #[prost(message, optional, tag = "3")]
1482        pub offset: ::core::option::Option<super::super::data::Datum>,
1483    }
1484    #[derive(prost_helpers::AnyPB)]
1485    #[derive(Clone, PartialEq, ::prost::Message)]
1486    pub struct SessionFrameBounds {
1487        #[prost(message, optional, tag = "1")]
1488        pub gap: ::core::option::Option<super::super::data::Datum>,
1489        #[prost(message, optional, tag = "10")]
1490        pub order_data_type: ::core::option::Option<super::super::data::DataType>,
1491        #[prost(message, optional, tag = "15")]
1492        pub order_type: ::core::option::Option<super::super::common::OrderType>,
1493        #[prost(message, optional, tag = "20")]
1494        pub gap_data_type: ::core::option::Option<super::super::data::DataType>,
1495    }
1496    #[derive(prost_helpers::AnyPB)]
1497    #[derive(
1498        Clone,
1499        Copy,
1500        Debug,
1501        PartialEq,
1502        Eq,
1503        Hash,
1504        PartialOrd,
1505        Ord,
1506        ::prost::Enumeration
1507    )]
1508    #[repr(i32)]
1509    pub enum Type {
1510        Unspecified = 0,
1511        /// Deprecated since we introduced `RANGE` frame.
1512        #[deprecated]
1513        RowsLegacy = 2,
1514        Rows = 5,
1515        Range = 10,
1516        Session = 15,
1517    }
1518    impl Type {
1519        /// String value of the enum field names used in the ProtoBuf definition.
1520        ///
1521        /// The values are not transformed in any way and thus are considered stable
1522        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1523        pub fn as_str_name(&self) -> &'static str {
1524            match self {
1525                Self::Unspecified => "TYPE_UNSPECIFIED",
1526                #[allow(deprecated)]
1527                Self::RowsLegacy => "TYPE_ROWS_LEGACY",
1528                Self::Rows => "TYPE_ROWS",
1529                Self::Range => "TYPE_RANGE",
1530                Self::Session => "TYPE_SESSION",
1531            }
1532        }
1533        /// Creates an enum from field names used in the ProtoBuf definition.
1534        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1535            match value {
1536                "TYPE_UNSPECIFIED" => Some(Self::Unspecified),
1537                "TYPE_ROWS_LEGACY" => Some(#[allow(deprecated)] Self::RowsLegacy),
1538                "TYPE_ROWS" => Some(Self::Rows),
1539                "TYPE_RANGE" => Some(Self::Range),
1540                "TYPE_SESSION" => Some(Self::Session),
1541                _ => None,
1542            }
1543        }
1544    }
1545    #[derive(prost_helpers::AnyPB)]
1546    #[derive(
1547        Clone,
1548        Copy,
1549        Debug,
1550        PartialEq,
1551        Eq,
1552        Hash,
1553        PartialOrd,
1554        Ord,
1555        ::prost::Enumeration
1556    )]
1557    #[repr(i32)]
1558    pub enum BoundType {
1559        Unspecified = 0,
1560        UnboundedPreceding = 1,
1561        Preceding = 2,
1562        CurrentRow = 3,
1563        Following = 4,
1564        UnboundedFollowing = 5,
1565    }
1566    impl BoundType {
1567        /// String value of the enum field names used in the ProtoBuf definition.
1568        ///
1569        /// The values are not transformed in any way and thus are considered stable
1570        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1571        pub fn as_str_name(&self) -> &'static str {
1572            match self {
1573                Self::Unspecified => "BOUND_TYPE_UNSPECIFIED",
1574                Self::UnboundedPreceding => "BOUND_TYPE_UNBOUNDED_PRECEDING",
1575                Self::Preceding => "BOUND_TYPE_PRECEDING",
1576                Self::CurrentRow => "BOUND_TYPE_CURRENT_ROW",
1577                Self::Following => "BOUND_TYPE_FOLLOWING",
1578                Self::UnboundedFollowing => "BOUND_TYPE_UNBOUNDED_FOLLOWING",
1579            }
1580        }
1581        /// Creates an enum from field names used in the ProtoBuf definition.
1582        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1583            match value {
1584                "BOUND_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
1585                "BOUND_TYPE_UNBOUNDED_PRECEDING" => Some(Self::UnboundedPreceding),
1586                "BOUND_TYPE_PRECEDING" => Some(Self::Preceding),
1587                "BOUND_TYPE_CURRENT_ROW" => Some(Self::CurrentRow),
1588                "BOUND_TYPE_FOLLOWING" => Some(Self::Following),
1589                "BOUND_TYPE_UNBOUNDED_FOLLOWING" => Some(Self::UnboundedFollowing),
1590                _ => None,
1591            }
1592        }
1593    }
1594    #[derive(prost_helpers::AnyPB)]
1595    #[derive(
1596        Clone,
1597        Copy,
1598        Debug,
1599        PartialEq,
1600        Eq,
1601        Hash,
1602        PartialOrd,
1603        Ord,
1604        ::prost::Enumeration
1605    )]
1606    #[repr(i32)]
1607    pub enum Exclusion {
1608        Unspecified = 0,
1609        CurrentRow = 1,
1610        /// EXCLUSION_GROUP = 2;
1611        /// EXCLUSION_TIES = 3;
1612        NoOthers = 4,
1613    }
1614    impl Exclusion {
1615        /// String value of the enum field names used in the ProtoBuf definition.
1616        ///
1617        /// The values are not transformed in any way and thus are considered stable
1618        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1619        pub fn as_str_name(&self) -> &'static str {
1620            match self {
1621                Self::Unspecified => "EXCLUSION_UNSPECIFIED",
1622                Self::CurrentRow => "EXCLUSION_CURRENT_ROW",
1623                Self::NoOthers => "EXCLUSION_NO_OTHERS",
1624            }
1625        }
1626        /// Creates an enum from field names used in the ProtoBuf definition.
1627        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1628            match value {
1629                "EXCLUSION_UNSPECIFIED" => Some(Self::Unspecified),
1630                "EXCLUSION_CURRENT_ROW" => Some(Self::CurrentRow),
1631                "EXCLUSION_NO_OTHERS" => Some(Self::NoOthers),
1632                _ => None,
1633            }
1634        }
1635    }
1636    #[derive(prost_helpers::AnyPB)]
1637    #[derive(Clone, PartialEq, ::prost::Oneof)]
1638    pub enum Bounds {
1639        #[prost(message, tag = "10")]
1640        Rows(RowsFrameBounds),
1641        #[prost(message, tag = "15")]
1642        Range(RangeFrameBounds),
1643        #[prost(message, tag = "20")]
1644        Session(SessionFrameBounds),
1645    }
1646}
1647#[derive(prost_helpers::AnyPB)]
1648#[derive(Clone, PartialEq, ::prost::Message)]
1649pub struct WindowFunction {
1650    #[prost(message, repeated, tag = "3")]
1651    pub args: ::prost::alloc::vec::Vec<InputRef>,
1652    #[prost(message, optional, tag = "4")]
1653    pub return_type: ::core::option::Option<super::data::DataType>,
1654    #[prost(message, optional, tag = "5")]
1655    pub frame: ::core::option::Option<WindowFrame>,
1656    #[prost(bool, tag = "6")]
1657    pub ignore_nulls: bool,
1658    #[prost(oneof = "window_function::Type", tags = "1, 2, 103")]
1659    pub r#type: ::core::option::Option<window_function::Type>,
1660}
1661/// Nested message and enum types in `WindowFunction`.
1662pub mod window_function {
1663    #[derive(prost_helpers::AnyPB)]
1664    #[derive(
1665        Clone,
1666        Copy,
1667        Debug,
1668        PartialEq,
1669        Eq,
1670        Hash,
1671        PartialOrd,
1672        Ord,
1673        ::prost::Enumeration
1674    )]
1675    #[repr(i32)]
1676    pub enum GeneralType {
1677        Unspecified = 0,
1678        RowNumber = 1,
1679        Rank = 2,
1680        DenseRank = 3,
1681        /// PERCENT_RANK = 4;
1682        /// CUME_DIST = 5;
1683        /// NTILE = 6;
1684        Lag = 7,
1685        Lead = 8,
1686    }
1687    impl GeneralType {
1688        /// String value of the enum field names used in the ProtoBuf definition.
1689        ///
1690        /// The values are not transformed in any way and thus are considered stable
1691        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1692        pub fn as_str_name(&self) -> &'static str {
1693            match self {
1694                Self::Unspecified => "UNSPECIFIED",
1695                Self::RowNumber => "ROW_NUMBER",
1696                Self::Rank => "RANK",
1697                Self::DenseRank => "DENSE_RANK",
1698                Self::Lag => "LAG",
1699                Self::Lead => "LEAD",
1700            }
1701        }
1702        /// Creates an enum from field names used in the ProtoBuf definition.
1703        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1704            match value {
1705                "UNSPECIFIED" => Some(Self::Unspecified),
1706                "ROW_NUMBER" => Some(Self::RowNumber),
1707                "RANK" => Some(Self::Rank),
1708                "DENSE_RANK" => Some(Self::DenseRank),
1709                "LAG" => Some(Self::Lag),
1710                "LEAD" => Some(Self::Lead),
1711                _ => None,
1712            }
1713        }
1714    }
1715    #[derive(prost_helpers::AnyPB)]
1716    #[derive(Clone, PartialEq, ::prost::Oneof)]
1717    pub enum Type {
1718        #[prost(enumeration = "GeneralType", tag = "1")]
1719        General(i32),
1720        /// Deprecated since we have a new `aggregate2` variant.
1721        #[deprecated]
1722        #[prost(enumeration = "super::agg_call::Kind", tag = "2")]
1723        Aggregate(i32),
1724        #[prost(message, tag = "103")]
1725        Aggregate2(super::AggType),
1726    }
1727}
1728#[derive(prost_helpers::AnyPB)]
1729#[derive(Eq, Hash)]
1730#[derive(Clone, PartialEq, ::prost::Message)]
1731pub struct UserDefinedFunction {
1732    #[prost(message, repeated, tag = "1")]
1733    pub children: ::prost::alloc::vec::Vec<ExprNode>,
1734    #[prost(string, tag = "2")]
1735    pub name: ::prost::alloc::string::String,
1736    #[prost(string, repeated, tag = "8")]
1737    pub arg_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1738    #[prost(message, repeated, tag = "3")]
1739    pub arg_types: ::prost::alloc::vec::Vec<super::data::DataType>,
1740    #[prost(string, tag = "4")]
1741    pub language: ::prost::alloc::string::String,
1742    /// The link to the external function service.
1743    #[prost(string, optional, tag = "5")]
1744    pub link: ::core::option::Option<::prost::alloc::string::String>,
1745    /// This is re-interpreted as `name_in_runtime`.
1746    #[prost(string, optional, tag = "6")]
1747    pub identifier: ::core::option::Option<::prost::alloc::string::String>,
1748    /// * If `language` is `javascript` or `python`, the source code of the function.
1749    #[prost(string, optional, tag = "7")]
1750    pub body: ::core::option::Option<::prost::alloc::string::String>,
1751    /// * If `language` is `rust` or `wasm`, the zstd-compressed wasm binary.
1752    #[prost(bytes = "vec", optional, tag = "10")]
1753    pub compressed_binary: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
1754    #[prost(bool, tag = "9")]
1755    pub always_retry_on_network_error: bool,
1756    /// The runtime selected when multiple runtimes are available for the language. Now is not used.
1757    #[prost(string, optional, tag = "11")]
1758    pub runtime: ::core::option::Option<::prost::alloc::string::String>,
1759    /// additional options for javascript functions
1760    #[prost(bool, optional, tag = "13")]
1761    pub is_async: ::core::option::Option<bool>,
1762    #[prost(bool, optional, tag = "14")]
1763    pub is_batched: ::core::option::Option<bool>,
1764    #[prost(enumeration = "UdfExprVersion", tag = "1000")]
1765    pub version: i32,
1766}
1767/// Additional information for user defined table/aggregate functions.
1768#[derive(prost_helpers::AnyPB)]
1769#[derive(Eq, Hash)]
1770#[derive(Clone, PartialEq, ::prost::Message)]
1771pub struct UserDefinedFunctionMetadata {
1772    #[prost(string, repeated, tag = "8")]
1773    pub arg_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1774    #[prost(message, repeated, tag = "3")]
1775    pub arg_types: ::prost::alloc::vec::Vec<super::data::DataType>,
1776    #[prost(message, optional, tag = "13")]
1777    pub return_type: ::core::option::Option<super::data::DataType>,
1778    #[prost(string, tag = "4")]
1779    pub language: ::prost::alloc::string::String,
1780    #[prost(string, optional, tag = "5")]
1781    pub link: ::core::option::Option<::prost::alloc::string::String>,
1782    /// This is re-interpreted as `name_in_runtime`.
1783    #[prost(string, optional, tag = "6")]
1784    pub identifier: ::core::option::Option<::prost::alloc::string::String>,
1785    #[prost(string, optional, tag = "7")]
1786    pub body: ::core::option::Option<::prost::alloc::string::String>,
1787    #[prost(bytes = "vec", optional, tag = "10")]
1788    pub compressed_binary: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
1789    #[prost(string, optional, tag = "11")]
1790    pub runtime: ::core::option::Option<::prost::alloc::string::String>,
1791    /// additional options for javascript functions
1792    #[prost(bool, optional, tag = "14")]
1793    pub is_async: ::core::option::Option<bool>,
1794    #[prost(bool, optional, tag = "15")]
1795    pub is_batched: ::core::option::Option<bool>,
1796    #[prost(enumeration = "UdfExprVersion", tag = "1000")]
1797    pub version: i32,
1798}
1799#[derive(prost_helpers::AnyPB)]
1800#[derive(prost_helpers::Version)]
1801#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1802#[repr(i32)]
1803pub enum UdfExprVersion {
1804    /// Versions before introducing this enum.
1805    Unspecified = 0,
1806    /// Begin from this version, we re-interpret `identifier` as `name_in_runtime`.
1807    NameInRuntime = 1,
1808}
1809impl UdfExprVersion {
1810    /// String value of the enum field names used in the ProtoBuf definition.
1811    ///
1812    /// The values are not transformed in any way and thus are considered stable
1813    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1814    pub fn as_str_name(&self) -> &'static str {
1815        match self {
1816            Self::Unspecified => "UDF_EXPR_VERSION_UNSPECIFIED",
1817            Self::NameInRuntime => "UDF_EXPR_VERSION_NAME_IN_RUNTIME",
1818        }
1819    }
1820    /// Creates an enum from field names used in the ProtoBuf definition.
1821    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1822        match value {
1823            "UDF_EXPR_VERSION_UNSPECIFIED" => Some(Self::Unspecified),
1824            "UDF_EXPR_VERSION_NAME_IN_RUNTIME" => Some(Self::NameInRuntime),
1825            _ => None,
1826        }
1827    }
1828}