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