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