risingwave_pb/
expr.rs

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