diff --git a/src/expr/src/scalar/func.proto b/src/expr/src/scalar/func.proto index dc34ab7b3ebc5..34cca74ff7dc1 100644 --- a/src/expr/src/scalar/func.proto +++ b/src/expr/src/scalar/func.proto @@ -369,3 +369,154 @@ message ProtoUnaryFunc { google.protobuf.Empty mz_type_name = 214; } } + +message ProtoBinaryFunc { + oneof kind { + google.protobuf.Empty and = 1; + google.protobuf.Empty or = 2; + google.protobuf.Empty add_int16 = 3; + google.protobuf.Empty add_int32 = 4; + google.protobuf.Empty add_int64 = 5; + google.protobuf.Empty add_float32 = 6; + google.protobuf.Empty add_float64 = 7; + google.protobuf.Empty add_interval = 8; + google.protobuf.Empty add_timestamp_interval = 9; + google.protobuf.Empty add_timestamp_tz_interval = 10; + google.protobuf.Empty add_date_interval = 11; + google.protobuf.Empty add_date_time = 12; + google.protobuf.Empty add_time_interval = 13; + google.protobuf.Empty add_numeric = 14; + google.protobuf.Empty bit_and_int16 = 15; + google.protobuf.Empty bit_and_int32 = 16; + google.protobuf.Empty bit_and_int64 = 17; + google.protobuf.Empty bit_or_int16 = 18; + google.protobuf.Empty bit_or_int32 = 19; + google.protobuf.Empty bit_or_int64 = 20; + google.protobuf.Empty bit_xor_int16 = 21; + google.protobuf.Empty bit_xor_int32 = 22; + google.protobuf.Empty bit_xor_int64 = 23; + google.protobuf.Empty bit_shift_left_int16 = 24; + google.protobuf.Empty bit_shift_left_int32 = 25; + google.protobuf.Empty bit_shift_left_int64 = 26; + google.protobuf.Empty bit_shift_right_int16 = 27; + google.protobuf.Empty bit_shift_right_int32 = 28; + google.protobuf.Empty bit_shift_right_int64 = 29; + google.protobuf.Empty sub_int16 = 30; + google.protobuf.Empty sub_int32 = 31; + google.protobuf.Empty sub_int64 = 32; + google.protobuf.Empty sub_float32 = 33; + google.protobuf.Empty sub_float64 = 34; + google.protobuf.Empty sub_interval = 35; + google.protobuf.Empty sub_timestamp = 36; + google.protobuf.Empty sub_timestamp_tz = 37; + google.protobuf.Empty sub_timestamp_interval = 38; + google.protobuf.Empty sub_timestamp_tz_interval = 39; + google.protobuf.Empty sub_date = 40; + google.protobuf.Empty sub_date_interval = 41; + google.protobuf.Empty sub_time = 42; + google.protobuf.Empty sub_time_interval = 43; + google.protobuf.Empty sub_numeric = 44; + google.protobuf.Empty mul_int16 = 45; + google.protobuf.Empty mul_int32 = 46; + google.protobuf.Empty mul_int64 = 47; + google.protobuf.Empty mul_float32 = 48; + google.protobuf.Empty mul_float64 = 49; + google.protobuf.Empty mul_numeric = 50; + google.protobuf.Empty mul_interval = 51; + google.protobuf.Empty div_int16 = 52; + google.protobuf.Empty div_int32 = 53; + google.protobuf.Empty div_int64 = 54; + google.protobuf.Empty div_float32 = 55; + google.protobuf.Empty div_float64 = 56; + google.protobuf.Empty div_numeric = 57; + google.protobuf.Empty div_interval = 58; + google.protobuf.Empty mod_int16 = 59; + google.protobuf.Empty mod_int32 = 60; + google.protobuf.Empty mod_int64 = 61; + google.protobuf.Empty mod_float32 = 62; + google.protobuf.Empty mod_float64 = 63; + google.protobuf.Empty mod_numeric = 64; + google.protobuf.Empty round_numeric = 65; + google.protobuf.Empty eq = 66; + google.protobuf.Empty not_eq = 67; + google.protobuf.Empty lt = 68; + google.protobuf.Empty lte = 69; + google.protobuf.Empty gt = 70; + google.protobuf.Empty gte = 71; + google.protobuf.Empty like_escape = 72; + // unsupported: IsLikeMatch { case_insensitive: bool } + google.protobuf.Empty is_like_match = 73; + // unsupported: IsRegexpMatch { case_insensitive: bool } + google.protobuf.Empty is_regexp_match = 74; + google.protobuf.Empty to_char_timestamp = 75; + google.protobuf.Empty to_char_timestamp_tz = 76; + google.protobuf.Empty date_bin_timestamp = 77; + google.protobuf.Empty date_bin_timestamp_tz = 78; + google.protobuf.Empty extract_interval = 79; + google.protobuf.Empty extract_time = 80; + google.protobuf.Empty extract_timestamp = 81; + google.protobuf.Empty extract_timestamp_tz = 82; + google.protobuf.Empty extract_date = 83; + google.protobuf.Empty date_part_interval = 84; + google.protobuf.Empty date_part_time = 85; + google.protobuf.Empty date_part_timestamp = 86; + google.protobuf.Empty date_part_timestamp_tz = 87; + google.protobuf.Empty date_trunc_timestamp = 88; + google.protobuf.Empty date_trunc_timestamp_tz = 89; + google.protobuf.Empty date_trunc_interval = 90; + google.protobuf.Empty timezone_timestamp = 91; + google.protobuf.Empty timezone_timestamp_tz = 92; + // unsupported: TimezoneTime { wall_time: NaiveDateTime } + google.protobuf.Empty timezone_time = 93; + google.protobuf.Empty timezone_interval_timestamp = 94; + google.protobuf.Empty timezone_interval_timestamp_tz = 95; + google.protobuf.Empty timezone_interval_time = 96; + google.protobuf.Empty text_concat = 97; + // unsupported: JsonbGetInt64 { stringify: bool } + google.protobuf.Empty jsonb_get_int64 = 98; + // unsupported: JsonbGetString { stringify: bool } + google.protobuf.Empty jsonb_get_string = 99; + // unsupported: JsonbGetPath { stringify: bool } + google.protobuf.Empty jsonb_get_path = 100; + google.protobuf.Empty jsonb_contains_string = 101; + google.protobuf.Empty jsonb_concat = 102; + google.protobuf.Empty jsonb_contains_jsonb = 103; + google.protobuf.Empty jsonb_delete_int64 = 104; + google.protobuf.Empty jsonb_delete_string = 105; + google.protobuf.Empty map_contains_key = 106; + google.protobuf.Empty map_get_value = 107; + google.protobuf.Empty map_get_values = 108; + google.protobuf.Empty map_contains_all_keys = 109; + google.protobuf.Empty map_contains_any_keys = 110; + google.protobuf.Empty map_contains_map = 111; + google.protobuf.Empty convert_from = 112; + google.protobuf.Empty left = 113; + google.protobuf.Empty position = 114; + google.protobuf.Empty right = 115; + google.protobuf.Empty repeat_string = 116; + google.protobuf.Empty trim = 117; + google.protobuf.Empty trim_leading = 118; + google.protobuf.Empty trim_trailing = 119; + google.protobuf.Empty encoded_bytes_char_length = 120; + // unsupported: ListLengthMax { max_layer: usize } + google.protobuf.Empty list_length_max = 121; + google.protobuf.Empty array_contains = 122; + google.protobuf.Empty array_length = 123; + google.protobuf.Empty array_lower = 124; + google.protobuf.Empty array_remove = 125; + google.protobuf.Empty array_upper = 126; + google.protobuf.Empty array_array_concat = 127; + google.protobuf.Empty list_list_concat = 128; + google.protobuf.Empty list_element_concat = 129; + google.protobuf.Empty element_list_concat = 130; + google.protobuf.Empty list_remove = 131; + google.protobuf.Empty digest_string = 132; + google.protobuf.Empty digest_bytes = 133; + google.protobuf.Empty mz_render_typmod = 134; + google.protobuf.Empty encode = 135; + google.protobuf.Empty decode = 136; + google.protobuf.Empty log_numeric = 137; + google.protobuf.Empty power = 138; + google.protobuf.Empty power_numeric = 139; + } +} diff --git a/src/expr/src/scalar/func.rs b/src/expr/src/scalar/func.rs index 6c1e21402dd62..3a1eb8cec43de 100644 --- a/src/expr/src/scalar/func.rs +++ b/src/expr/src/scalar/func.rs @@ -3261,6 +3261,309 @@ impl Arbitrary for BinaryFunc { } } +impl From<&BinaryFunc> for ProtoBinaryFunc { + #[allow(clippy::todo)] + fn from(func: &BinaryFunc) -> Self { + use proto_binary_func::Kind::*; + let kind = match func { + BinaryFunc::And => And(()), + BinaryFunc::Or => Or(()), + BinaryFunc::AddInt16 => AddInt16(()), + BinaryFunc::AddInt32 => AddInt32(()), + BinaryFunc::AddInt64 => AddInt64(()), + BinaryFunc::AddFloat32 => AddFloat32(()), + BinaryFunc::AddFloat64 => AddFloat64(()), + BinaryFunc::AddInterval => AddInterval(()), + BinaryFunc::AddTimestampInterval => AddTimestampInterval(()), + BinaryFunc::AddTimestampTzInterval => AddTimestampTzInterval(()), + BinaryFunc::AddDateInterval => AddDateInterval(()), + BinaryFunc::AddDateTime => AddDateTime(()), + BinaryFunc::AddTimeInterval => AddTimeInterval(()), + BinaryFunc::AddNumeric => AddNumeric(()), + BinaryFunc::BitAndInt16 => BitAndInt16(()), + BinaryFunc::BitAndInt32 => BitAndInt32(()), + BinaryFunc::BitAndInt64 => BitAndInt64(()), + BinaryFunc::BitOrInt16 => BitOrInt16(()), + BinaryFunc::BitOrInt32 => BitOrInt32(()), + BinaryFunc::BitOrInt64 => BitOrInt64(()), + BinaryFunc::BitXorInt16 => BitXorInt16(()), + BinaryFunc::BitXorInt32 => BitXorInt32(()), + BinaryFunc::BitXorInt64 => BitXorInt64(()), + BinaryFunc::BitShiftLeftInt16 => BitShiftLeftInt16(()), + BinaryFunc::BitShiftLeftInt32 => BitShiftLeftInt32(()), + BinaryFunc::BitShiftLeftInt64 => BitShiftLeftInt64(()), + BinaryFunc::BitShiftRightInt16 => BitShiftRightInt16(()), + BinaryFunc::BitShiftRightInt32 => BitShiftRightInt32(()), + BinaryFunc::BitShiftRightInt64 => BitShiftRightInt64(()), + BinaryFunc::SubInt16 => SubInt16(()), + BinaryFunc::SubInt32 => SubInt32(()), + BinaryFunc::SubInt64 => SubInt64(()), + BinaryFunc::SubFloat32 => SubFloat32(()), + BinaryFunc::SubFloat64 => SubFloat64(()), + BinaryFunc::SubInterval => SubInterval(()), + BinaryFunc::SubTimestamp => SubTimestamp(()), + BinaryFunc::SubTimestampTz => SubTimestampTz(()), + BinaryFunc::SubTimestampInterval => SubTimestampInterval(()), + BinaryFunc::SubTimestampTzInterval => SubTimestampTzInterval(()), + BinaryFunc::SubDate => SubDate(()), + BinaryFunc::SubDateInterval => SubDateInterval(()), + BinaryFunc::SubTime => SubTime(()), + BinaryFunc::SubTimeInterval => SubTimeInterval(()), + BinaryFunc::SubNumeric => SubNumeric(()), + BinaryFunc::MulInt16 => MulInt16(()), + BinaryFunc::MulInt32 => MulInt32(()), + BinaryFunc::MulInt64 => MulInt64(()), + BinaryFunc::MulFloat32 => MulFloat32(()), + BinaryFunc::MulFloat64 => MulFloat64(()), + BinaryFunc::MulNumeric => MulNumeric(()), + BinaryFunc::MulInterval => MulInterval(()), + BinaryFunc::DivInt16 => DivInt16(()), + BinaryFunc::DivInt32 => DivInt32(()), + BinaryFunc::DivInt64 => DivInt64(()), + BinaryFunc::DivFloat32 => DivFloat32(()), + BinaryFunc::DivFloat64 => DivFloat64(()), + BinaryFunc::DivNumeric => DivNumeric(()), + BinaryFunc::DivInterval => DivInterval(()), + BinaryFunc::ModInt16 => ModInt16(()), + BinaryFunc::ModInt32 => ModInt32(()), + BinaryFunc::ModInt64 => ModInt64(()), + BinaryFunc::ModFloat32 => ModFloat32(()), + BinaryFunc::ModFloat64 => ModFloat64(()), + BinaryFunc::ModNumeric => ModNumeric(()), + BinaryFunc::RoundNumeric => RoundNumeric(()), + BinaryFunc::Eq => Eq(()), + BinaryFunc::NotEq => NotEq(()), + BinaryFunc::Lt => Lt(()), + BinaryFunc::Lte => Lte(()), + BinaryFunc::Gt => Gt(()), + BinaryFunc::Gte => Gte(()), + BinaryFunc::LikeEscape => LikeEscape(()), + BinaryFunc::IsLikeMatch { .. } => IsLikeMatch(()), + BinaryFunc::IsRegexpMatch { .. } => IsRegexpMatch(()), + BinaryFunc::ToCharTimestamp => ToCharTimestamp(()), + BinaryFunc::ToCharTimestampTz => ToCharTimestampTz(()), + BinaryFunc::DateBinTimestamp => DateBinTimestamp(()), + BinaryFunc::DateBinTimestampTz => DateBinTimestampTz(()), + BinaryFunc::ExtractInterval => ExtractInterval(()), + BinaryFunc::ExtractTime => ExtractTime(()), + BinaryFunc::ExtractTimestamp => ExtractTimestamp(()), + BinaryFunc::ExtractTimestampTz => ExtractTimestampTz(()), + BinaryFunc::ExtractDate => ExtractDate(()), + BinaryFunc::DatePartInterval => DatePartInterval(()), + BinaryFunc::DatePartTime => DatePartTime(()), + BinaryFunc::DatePartTimestamp => DatePartTimestamp(()), + BinaryFunc::DatePartTimestampTz => DatePartTimestampTz(()), + BinaryFunc::DateTruncTimestamp => DateTruncTimestamp(()), + BinaryFunc::DateTruncTimestampTz => DateTruncTimestampTz(()), + BinaryFunc::DateTruncInterval => DateTruncInterval(()), + BinaryFunc::TimezoneTimestamp => TimezoneTimestamp(()), + BinaryFunc::TimezoneTimestampTz => TimezoneTimestampTz(()), + BinaryFunc::TimezoneTime { .. } => TimezoneTime(()), + BinaryFunc::TimezoneIntervalTimestamp => TimezoneIntervalTimestamp(()), + BinaryFunc::TimezoneIntervalTimestampTz => TimezoneIntervalTimestampTz(()), + BinaryFunc::TimezoneIntervalTime => TimezoneIntervalTime(()), + BinaryFunc::TextConcat => TextConcat(()), + BinaryFunc::JsonbGetInt64 { .. } => JsonbGetInt64(()), + BinaryFunc::JsonbGetString { .. } => JsonbGetString(()), + BinaryFunc::JsonbGetPath { .. } => JsonbGetPath(()), + BinaryFunc::JsonbContainsString => JsonbContainsString(()), + BinaryFunc::JsonbConcat => JsonbConcat(()), + BinaryFunc::JsonbContainsJsonb => JsonbContainsJsonb(()), + BinaryFunc::JsonbDeleteInt64 => JsonbDeleteInt64(()), + BinaryFunc::JsonbDeleteString => JsonbDeleteString(()), + BinaryFunc::MapContainsKey => MapContainsKey(()), + BinaryFunc::MapGetValue => MapGetValue(()), + BinaryFunc::MapGetValues => MapGetValues(()), + BinaryFunc::MapContainsAllKeys => MapContainsAllKeys(()), + BinaryFunc::MapContainsAnyKeys => MapContainsAnyKeys(()), + BinaryFunc::MapContainsMap => MapContainsMap(()), + BinaryFunc::ConvertFrom => ConvertFrom(()), + BinaryFunc::Left => Left(()), + BinaryFunc::Position => Position(()), + BinaryFunc::Right => Right(()), + BinaryFunc::RepeatString => RepeatString(()), + BinaryFunc::Trim => Trim(()), + BinaryFunc::TrimLeading => TrimLeading(()), + BinaryFunc::TrimTrailing => TrimTrailing(()), + BinaryFunc::EncodedBytesCharLength => EncodedBytesCharLength(()), + BinaryFunc::ListLengthMax { .. } => ListLengthMax(()), + BinaryFunc::ArrayContains => ArrayContains(()), + BinaryFunc::ArrayLength => ArrayLength(()), + BinaryFunc::ArrayLower => ArrayLower(()), + BinaryFunc::ArrayRemove => ArrayRemove(()), + BinaryFunc::ArrayUpper => ArrayUpper(()), + BinaryFunc::ArrayArrayConcat => ArrayArrayConcat(()), + BinaryFunc::ListListConcat => ListListConcat(()), + BinaryFunc::ListElementConcat => ListElementConcat(()), + BinaryFunc::ElementListConcat => ElementListConcat(()), + BinaryFunc::ListRemove => ListRemove(()), + BinaryFunc::DigestString => DigestString(()), + BinaryFunc::DigestBytes => DigestBytes(()), + BinaryFunc::MzRenderTypmod => MzRenderTypmod(()), + BinaryFunc::Encode => Encode(()), + BinaryFunc::Decode => Decode(()), + BinaryFunc::LogNumeric => LogNumeric(()), + BinaryFunc::Power => Power(()), + BinaryFunc::PowerNumeric => PowerNumeric(()), + }; + ProtoBinaryFunc { kind: Some(kind) } + } +} + +impl TryFrom for BinaryFunc { + type Error = TryFromProtoError; + + #[allow(clippy::todo)] + fn try_from(func: ProtoBinaryFunc) -> Result { + use proto_binary_func::Kind::*; + if let Some(kind) = func.kind { + match kind { + And(()) => Ok(BinaryFunc::And), + Or(()) => Ok(BinaryFunc::Or), + AddInt16(()) => Ok(BinaryFunc::AddInt16), + AddInt32(()) => Ok(BinaryFunc::AddInt32), + AddInt64(()) => Ok(BinaryFunc::AddInt64), + AddFloat32(()) => Ok(BinaryFunc::AddFloat32), + AddFloat64(()) => Ok(BinaryFunc::AddFloat64), + AddInterval(()) => Ok(BinaryFunc::AddInterval), + AddTimestampInterval(()) => Ok(BinaryFunc::AddTimestampInterval), + AddTimestampTzInterval(()) => Ok(BinaryFunc::AddTimestampTzInterval), + AddDateInterval(()) => Ok(BinaryFunc::AddDateInterval), + AddDateTime(()) => Ok(BinaryFunc::AddDateTime), + AddTimeInterval(()) => Ok(BinaryFunc::AddTimeInterval), + AddNumeric(()) => Ok(BinaryFunc::AddNumeric), + BitAndInt16(()) => Ok(BinaryFunc::BitAndInt16), + BitAndInt32(()) => Ok(BinaryFunc::BitAndInt32), + BitAndInt64(()) => Ok(BinaryFunc::BitAndInt64), + BitOrInt16(()) => Ok(BinaryFunc::BitOrInt16), + BitOrInt32(()) => Ok(BinaryFunc::BitOrInt32), + BitOrInt64(()) => Ok(BinaryFunc::BitOrInt64), + BitXorInt16(()) => Ok(BinaryFunc::BitXorInt16), + BitXorInt32(()) => Ok(BinaryFunc::BitXorInt32), + BitXorInt64(()) => Ok(BinaryFunc::BitXorInt64), + BitShiftLeftInt16(()) => Ok(BinaryFunc::BitShiftLeftInt16), + BitShiftLeftInt32(()) => Ok(BinaryFunc::BitShiftLeftInt32), + BitShiftLeftInt64(()) => Ok(BinaryFunc::BitShiftLeftInt64), + BitShiftRightInt16(()) => Ok(BinaryFunc::BitShiftRightInt16), + BitShiftRightInt32(()) => Ok(BinaryFunc::BitShiftRightInt32), + BitShiftRightInt64(()) => Ok(BinaryFunc::BitShiftRightInt64), + SubInt16(()) => Ok(BinaryFunc::SubInt16), + SubInt32(()) => Ok(BinaryFunc::SubInt32), + SubInt64(()) => Ok(BinaryFunc::SubInt64), + SubFloat32(()) => Ok(BinaryFunc::SubFloat32), + SubFloat64(()) => Ok(BinaryFunc::SubFloat64), + SubInterval(()) => Ok(BinaryFunc::SubInterval), + SubTimestamp(()) => Ok(BinaryFunc::SubTimestamp), + SubTimestampTz(()) => Ok(BinaryFunc::SubTimestampTz), + SubTimestampInterval(()) => Ok(BinaryFunc::SubTimestampInterval), + SubTimestampTzInterval(()) => Ok(BinaryFunc::SubTimestampTzInterval), + SubDate(()) => Ok(BinaryFunc::SubDate), + SubDateInterval(()) => Ok(BinaryFunc::SubDateInterval), + SubTime(()) => Ok(BinaryFunc::SubTime), + SubTimeInterval(()) => Ok(BinaryFunc::SubTimeInterval), + SubNumeric(()) => Ok(BinaryFunc::SubNumeric), + MulInt16(()) => Ok(BinaryFunc::MulInt16), + MulInt32(()) => Ok(BinaryFunc::MulInt32), + MulInt64(()) => Ok(BinaryFunc::MulInt64), + MulFloat32(()) => Ok(BinaryFunc::MulFloat32), + MulFloat64(()) => Ok(BinaryFunc::MulFloat64), + MulNumeric(()) => Ok(BinaryFunc::MulNumeric), + MulInterval(()) => Ok(BinaryFunc::MulInterval), + DivInt16(()) => Ok(BinaryFunc::DivInt16), + DivInt32(()) => Ok(BinaryFunc::DivInt32), + DivInt64(()) => Ok(BinaryFunc::DivInt64), + DivFloat32(()) => Ok(BinaryFunc::DivFloat32), + DivFloat64(()) => Ok(BinaryFunc::DivFloat64), + DivNumeric(()) => Ok(BinaryFunc::DivNumeric), + DivInterval(()) => Ok(BinaryFunc::DivInterval), + ModInt16(()) => Ok(BinaryFunc::ModInt16), + ModInt32(()) => Ok(BinaryFunc::ModInt32), + ModInt64(()) => Ok(BinaryFunc::ModInt64), + ModFloat32(()) => Ok(BinaryFunc::ModFloat32), + ModFloat64(()) => Ok(BinaryFunc::ModFloat64), + ModNumeric(()) => Ok(BinaryFunc::ModNumeric), + RoundNumeric(()) => Ok(BinaryFunc::RoundNumeric), + Eq(()) => Ok(BinaryFunc::Eq), + NotEq(()) => Ok(BinaryFunc::NotEq), + Lt(()) => Ok(BinaryFunc::Lt), + Lte(()) => Ok(BinaryFunc::Lte), + Gt(()) => Ok(BinaryFunc::Gt), + Gte(()) => Ok(BinaryFunc::Gte), + LikeEscape(()) => Ok(BinaryFunc::LikeEscape), + IsLikeMatch(()) => todo!(), + IsRegexpMatch(()) => todo!(), + ToCharTimestamp(()) => Ok(BinaryFunc::ToCharTimestamp), + ToCharTimestampTz(()) => Ok(BinaryFunc::ToCharTimestampTz), + DateBinTimestamp(()) => Ok(BinaryFunc::DateBinTimestamp), + DateBinTimestampTz(()) => Ok(BinaryFunc::DateBinTimestampTz), + ExtractInterval(()) => Ok(BinaryFunc::ExtractInterval), + ExtractTime(()) => Ok(BinaryFunc::ExtractTime), + ExtractTimestamp(()) => Ok(BinaryFunc::ExtractTimestamp), + ExtractTimestampTz(()) => Ok(BinaryFunc::ExtractTimestampTz), + ExtractDate(()) => Ok(BinaryFunc::ExtractDate), + DatePartInterval(()) => Ok(BinaryFunc::DatePartInterval), + DatePartTime(()) => Ok(BinaryFunc::DatePartTime), + DatePartTimestamp(()) => Ok(BinaryFunc::DatePartTimestamp), + DatePartTimestampTz(()) => Ok(BinaryFunc::DatePartTimestampTz), + DateTruncTimestamp(()) => Ok(BinaryFunc::DateTruncTimestamp), + DateTruncTimestampTz(()) => Ok(BinaryFunc::DateTruncTimestampTz), + DateTruncInterval(()) => Ok(BinaryFunc::DateTruncInterval), + TimezoneTimestamp(()) => Ok(BinaryFunc::TimezoneTimestamp), + TimezoneTimestampTz(()) => Ok(BinaryFunc::TimezoneTimestampTz), + TimezoneTime(()) => todo!(), + TimezoneIntervalTimestamp(()) => Ok(BinaryFunc::TimezoneIntervalTimestamp), + TimezoneIntervalTimestampTz(()) => Ok(BinaryFunc::TimezoneIntervalTimestampTz), + TimezoneIntervalTime(()) => Ok(BinaryFunc::TimezoneIntervalTime), + TextConcat(()) => Ok(BinaryFunc::TextConcat), + JsonbGetInt64(()) => todo!(), + JsonbGetString(()) => todo!(), + JsonbGetPath(()) => todo!(), + JsonbContainsString(()) => Ok(BinaryFunc::JsonbContainsString), + JsonbConcat(()) => Ok(BinaryFunc::JsonbConcat), + JsonbContainsJsonb(()) => Ok(BinaryFunc::JsonbContainsJsonb), + JsonbDeleteInt64(()) => Ok(BinaryFunc::JsonbDeleteInt64), + JsonbDeleteString(()) => Ok(BinaryFunc::JsonbDeleteString), + MapContainsKey(()) => Ok(BinaryFunc::MapContainsKey), + MapGetValue(()) => Ok(BinaryFunc::MapGetValue), + MapGetValues(()) => Ok(BinaryFunc::MapGetValues), + MapContainsAllKeys(()) => Ok(BinaryFunc::MapContainsAllKeys), + MapContainsAnyKeys(()) => Ok(BinaryFunc::MapContainsAnyKeys), + MapContainsMap(()) => Ok(BinaryFunc::MapContainsMap), + ConvertFrom(()) => Ok(BinaryFunc::ConvertFrom), + Left(()) => Ok(BinaryFunc::Left), + Position(()) => Ok(BinaryFunc::Position), + Right(()) => Ok(BinaryFunc::Right), + RepeatString(()) => Ok(BinaryFunc::RepeatString), + Trim(()) => Ok(BinaryFunc::Trim), + TrimLeading(()) => Ok(BinaryFunc::TrimLeading), + TrimTrailing(()) => Ok(BinaryFunc::TrimTrailing), + EncodedBytesCharLength(()) => Ok(BinaryFunc::EncodedBytesCharLength), + ListLengthMax(()) => todo!(), + ArrayContains(()) => Ok(BinaryFunc::ArrayContains), + ArrayLength(()) => Ok(BinaryFunc::ArrayLength), + ArrayLower(()) => Ok(BinaryFunc::ArrayLower), + ArrayRemove(()) => Ok(BinaryFunc::ArrayRemove), + ArrayUpper(()) => Ok(BinaryFunc::ArrayUpper), + ArrayArrayConcat(()) => Ok(BinaryFunc::ArrayArrayConcat), + ListListConcat(()) => Ok(BinaryFunc::ListListConcat), + ListElementConcat(()) => Ok(BinaryFunc::ListElementConcat), + ElementListConcat(()) => Ok(BinaryFunc::ElementListConcat), + ListRemove(()) => Ok(BinaryFunc::ListRemove), + DigestString(()) => Ok(BinaryFunc::DigestString), + DigestBytes(()) => Ok(BinaryFunc::DigestBytes), + MzRenderTypmod(()) => Ok(BinaryFunc::MzRenderTypmod), + Encode(()) => Ok(BinaryFunc::Encode), + Decode(()) => Ok(BinaryFunc::Decode), + LogNumeric(()) => Ok(BinaryFunc::LogNumeric), + Power(()) => Ok(BinaryFunc::Power), + PowerNumeric(()) => Ok(BinaryFunc::PowerNumeric), + } + } else { + Err(TryFromProtoError::missing_field("`ProtoBinaryFunc::kind`")) + } + } +} + /// A description of an SQL unary function that has the ability to lazy evaluate its arguments // This trait will eventualy be annotated with #[enum_dispatch] to autogenerate the UnaryFunc enum trait LazyUnaryFunc {