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