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