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