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