From 3bd70cf13aa5667ab92ac6422bb49443e48491bd Mon Sep 17 00:00:00 2001 From: liugddx Date: Fri, 2 Feb 2024 14:11:05 +0800 Subject: [PATCH] 1 --- .../doris/catalog/BuiltinScalarFunctions.java | 413 +----------------- .../functions/scalar/UrlDecode.java | 69 +++ .../visitor/ScalarFunctionVisitor.java | 5 + 3 files changed, 77 insertions(+), 410 deletions(-) create mode 100644 fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/UrlDecode.java diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/BuiltinScalarFunctions.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/BuiltinScalarFunctions.java index 94a1aaaaace259..6c2f38fa6c91ef 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/BuiltinScalarFunctions.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/BuiltinScalarFunctions.java @@ -19,418 +19,10 @@ import org.apache.doris.nereids.trees.expressions.Like; import org.apache.doris.nereids.trees.expressions.Regexp; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Abs; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Acos; -import org.apache.doris.nereids.trees.expressions.functions.scalar.AesDecrypt; -import org.apache.doris.nereids.trees.expressions.functions.scalar.AesDecryptV2; -import org.apache.doris.nereids.trees.expressions.functions.scalar.AesEncrypt; -import org.apache.doris.nereids.trees.expressions.functions.scalar.AesEncryptV2; -import org.apache.doris.nereids.trees.expressions.functions.scalar.AppendTrailingCharIfAbsent; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Array; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayApply; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayAvg; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayCompact; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayConcat; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayContains; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayCount; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayCumSum; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayDifference; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayDistinct; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayEnumerate; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayEnumerateUniq; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayExcept; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayExists; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayFilter; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayFirst; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayFirstIndex; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayIntersect; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayJoin; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayLast; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayLastIndex; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayMap; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayMax; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayMin; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayPopBack; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayPopFront; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayPosition; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayProduct; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayPushBack; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayPushFront; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayRange; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayRemove; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayRepeat; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayReverseSort; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayShuffle; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArraySlice; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArraySort; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArraySortBy; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArraySum; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayUnion; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayWithConstant; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayZip; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ArraysOverlap; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Ascii; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Asin; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Atan; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Bin; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitCount; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitLength; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitShiftLeft; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitShiftRight; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapAnd; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapAndCount; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapAndNot; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapAndNotAlias; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapAndNotCount; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapAndNotCountAlias; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapContains; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapCount; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapEmpty; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapFromArray; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapFromBase64; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapFromString; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapHasAll; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapHasAny; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapHash; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapHash64; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapMax; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapMin; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapNot; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapOr; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapOrCount; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapRemove; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapSubsetInRange; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapSubsetLimit; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapToArray; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapToBase64; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapToString; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapXor; -import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapXorCount; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Cardinality; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Cbrt; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Ceil; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Char; -import org.apache.doris.nereids.trees.expressions.functions.scalar.CharacterLength; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Coalesce; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Concat; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ConcatWs; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ConnectionId; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Conv; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ConvertTo; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ConvertTz; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Cos; -import org.apache.doris.nereids.trees.expressions.functions.scalar.CosineDistance; -import org.apache.doris.nereids.trees.expressions.functions.scalar.CountEqual; -import org.apache.doris.nereids.trees.expressions.functions.scalar.CreateMap; -import org.apache.doris.nereids.trees.expressions.functions.scalar.CreateNamedStruct; -import org.apache.doris.nereids.trees.expressions.functions.scalar.CreateStruct; -import org.apache.doris.nereids.trees.expressions.functions.scalar.CurrentCatalog; -import org.apache.doris.nereids.trees.expressions.functions.scalar.CurrentDate; -import org.apache.doris.nereids.trees.expressions.functions.scalar.CurrentTime; -import org.apache.doris.nereids.trees.expressions.functions.scalar.CurrentUser; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Database; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Date; -import org.apache.doris.nereids.trees.expressions.functions.scalar.DateDiff; -import org.apache.doris.nereids.trees.expressions.functions.scalar.DateFormat; -import org.apache.doris.nereids.trees.expressions.functions.scalar.DateTrunc; -import org.apache.doris.nereids.trees.expressions.functions.scalar.DateV2; -import org.apache.doris.nereids.trees.expressions.functions.scalar.DayCeil; -import org.apache.doris.nereids.trees.expressions.functions.scalar.DayFloor; -import org.apache.doris.nereids.trees.expressions.functions.scalar.DayName; -import org.apache.doris.nereids.trees.expressions.functions.scalar.DayOfMonth; -import org.apache.doris.nereids.trees.expressions.functions.scalar.DayOfWeek; -import org.apache.doris.nereids.trees.expressions.functions.scalar.DayOfYear; -import org.apache.doris.nereids.trees.expressions.functions.scalar.DaysAdd; -import org.apache.doris.nereids.trees.expressions.functions.scalar.DaysDiff; -import org.apache.doris.nereids.trees.expressions.functions.scalar.DaysSub; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Dceil; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Degrees; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Dexp; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Dfloor; -import org.apache.doris.nereids.trees.expressions.functions.scalar.DigitalMasking; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Dlog1; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Dlog10; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Domain; -import org.apache.doris.nereids.trees.expressions.functions.scalar.DomainWithoutWww; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Dpow; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Dround; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Dsqrt; -import org.apache.doris.nereids.trees.expressions.functions.scalar.E; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ElementAt; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Elt; -import org.apache.doris.nereids.trees.expressions.functions.scalar.EndsWith; -import org.apache.doris.nereids.trees.expressions.functions.scalar.EsQuery; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Exp; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ExtractUrlParameter; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Field; -import org.apache.doris.nereids.trees.expressions.functions.scalar.FindInSet; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Floor; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Fmod; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Fpow; -import org.apache.doris.nereids.trees.expressions.functions.scalar.FromBase64; -import org.apache.doris.nereids.trees.expressions.functions.scalar.FromDays; -import org.apache.doris.nereids.trees.expressions.functions.scalar.FromMicrosecond; -import org.apache.doris.nereids.trees.expressions.functions.scalar.FromMillisecond; -import org.apache.doris.nereids.trees.expressions.functions.scalar.FromSecond; -import org.apache.doris.nereids.trees.expressions.functions.scalar.FromUnixtime; -import org.apache.doris.nereids.trees.expressions.functions.scalar.G; -import org.apache.doris.nereids.trees.expressions.functions.scalar.GetJsonBigInt; -import org.apache.doris.nereids.trees.expressions.functions.scalar.GetJsonDouble; -import org.apache.doris.nereids.trees.expressions.functions.scalar.GetJsonInt; -import org.apache.doris.nereids.trees.expressions.functions.scalar.GetJsonString; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Greatest; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Grouping; -import org.apache.doris.nereids.trees.expressions.functions.scalar.GroupingId; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Hex; -import org.apache.doris.nereids.trees.expressions.functions.scalar.HllCardinality; -import org.apache.doris.nereids.trees.expressions.functions.scalar.HllEmpty; -import org.apache.doris.nereids.trees.expressions.functions.scalar.HllHash; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Hour; -import org.apache.doris.nereids.trees.expressions.functions.scalar.HourCeil; -import org.apache.doris.nereids.trees.expressions.functions.scalar.HourFloor; -import org.apache.doris.nereids.trees.expressions.functions.scalar.HoursAdd; -import org.apache.doris.nereids.trees.expressions.functions.scalar.HoursDiff; -import org.apache.doris.nereids.trees.expressions.functions.scalar.HoursSub; -import org.apache.doris.nereids.trees.expressions.functions.scalar.If; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Ignore; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Initcap; -import org.apache.doris.nereids.trees.expressions.functions.scalar.InnerProduct; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Instr; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Ipv4CIDRToRange; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Ipv4NumToString; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Ipv4StringToNum; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Ipv4StringToNumOrDefault; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Ipv4StringToNumOrNull; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Ipv6CIDRToRange; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Ipv6NumToString; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Ipv6StringToNum; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Ipv6StringToNumOrDefault; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Ipv6StringToNumOrNull; -import org.apache.doris.nereids.trees.expressions.functions.scalar.IsIpAddressInRange; -import org.apache.doris.nereids.trees.expressions.functions.scalar.IsIpv4Compat; -import org.apache.doris.nereids.trees.expressions.functions.scalar.IsIpv4Mapped; -import org.apache.doris.nereids.trees.expressions.functions.scalar.IsIpv4String; -import org.apache.doris.nereids.trees.expressions.functions.scalar.IsIpv6String; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonArray; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonContains; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonExtract; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonInsert; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonLength; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonObject; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonQuote; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonReplace; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonSet; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonUnQuote; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonbExistsPath; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonbExtract; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonbExtractBigint; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonbExtractBool; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonbExtractDouble; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonbExtractInt; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonbExtractIsnull; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonbExtractLargeint; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonbExtractString; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonbParse; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonbParseErrorToInvalid; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonbParseErrorToNull; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonbParseErrorToValue; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonbParseNotnull; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonbParseNotnullErrorToInvalid; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonbParseNotnullErrorToValue; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonbParseNullable; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonbParseNullableErrorToInvalid; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonbParseNullableErrorToNull; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonbParseNullableErrorToValue; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonbType; -import org.apache.doris.nereids.trees.expressions.functions.scalar.JsonbValid; -import org.apache.doris.nereids.trees.expressions.functions.scalar.L1Distance; -import org.apache.doris.nereids.trees.expressions.functions.scalar.L2Distance; -import org.apache.doris.nereids.trees.expressions.functions.scalar.LastDay; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Least; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Left; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Length; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Ln; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Locate; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Log; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Log10; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Log2; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Lower; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Lpad; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Ltrim; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MakeDate; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MapContainsKey; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MapContainsValue; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MapKeys; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MapSize; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MapValues; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Mask; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MaskFirstN; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MaskLastN; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Md5; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Md5Sum; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MicroSecondTimestamp; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MicroSecondsAdd; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MicroSecondsDiff; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MicroSecondsSub; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Microsecond; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MilliSecondTimestamp; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MilliSecondsAdd; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MilliSecondsDiff; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MilliSecondsSub; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Minute; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MinuteCeil; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MinuteFloor; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MinutesAdd; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MinutesDiff; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MinutesSub; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MoneyFormat; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Month; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MonthCeil; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MonthFloor; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MonthName; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MonthsAdd; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MonthsDiff; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MonthsSub; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MultiMatchAny; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MultiSearchAllPositions; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MurmurHash332; -import org.apache.doris.nereids.trees.expressions.functions.scalar.MurmurHash364; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Negative; -import org.apache.doris.nereids.trees.expressions.functions.scalar.NonNullable; -import org.apache.doris.nereids.trees.expressions.functions.scalar.NotNullOrEmpty; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Now; -import org.apache.doris.nereids.trees.expressions.functions.scalar.NullIf; -import org.apache.doris.nereids.trees.expressions.functions.scalar.NullOrEmpty; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Nullable; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Nvl; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ParseUrl; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Password; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Pi; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Pmod; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Positive; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Pow; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Power; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Protocol; -import org.apache.doris.nereids.trees.expressions.functions.scalar.QuantilePercent; -import org.apache.doris.nereids.trees.expressions.functions.scalar.QuantileStateEmpty; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Quarter; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Radians; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Random; -import org.apache.doris.nereids.trees.expressions.functions.scalar.RegexpExtract; -import org.apache.doris.nereids.trees.expressions.functions.scalar.RegexpExtractAll; -import org.apache.doris.nereids.trees.expressions.functions.scalar.RegexpReplace; -import org.apache.doris.nereids.trees.expressions.functions.scalar.RegexpReplaceOne; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Repeat; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Replace; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Reverse; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Right; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Round; -import org.apache.doris.nereids.trees.expressions.functions.scalar.RoundBankers; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Rpad; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Rtrim; -import org.apache.doris.nereids.trees.expressions.functions.scalar.SecToTime; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Second; -import org.apache.doris.nereids.trees.expressions.functions.scalar.SecondCeil; -import org.apache.doris.nereids.trees.expressions.functions.scalar.SecondFloor; -import org.apache.doris.nereids.trees.expressions.functions.scalar.SecondTimestamp; -import org.apache.doris.nereids.trees.expressions.functions.scalar.SecondsAdd; -import org.apache.doris.nereids.trees.expressions.functions.scalar.SecondsDiff; -import org.apache.doris.nereids.trees.expressions.functions.scalar.SecondsSub; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Sha1; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Sha2; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Sign; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Sin; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Sleep; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Sm3; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Sm3sum; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Sm4Decrypt; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Sm4DecryptV2; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Sm4Encrypt; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Sm4EncryptV2; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Space; -import org.apache.doris.nereids.trees.expressions.functions.scalar.SplitByChar; -import org.apache.doris.nereids.trees.expressions.functions.scalar.SplitByString; -import org.apache.doris.nereids.trees.expressions.functions.scalar.SplitPart; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Sqrt; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StAngle; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StAngleSphere; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StAreaSquareKm; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StAreaSquareMeters; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StAsBinary; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StAstext; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StAswkt; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StAzimuth; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StCircle; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StContains; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StDistanceSphere; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StGeomFromWKB; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StGeometryFromWKB; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StGeometryfromtext; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StGeomfromtext; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StLinefromtext; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StLinestringfromtext; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StPoint; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StPolyfromtext; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StPolygon; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StPolygonfromtext; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StX; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StY; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StartsWith; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StrLeft; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StrRight; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StrToDate; -import org.apache.doris.nereids.trees.expressions.functions.scalar.StructElement; -import org.apache.doris.nereids.trees.expressions.functions.scalar.SubBitmap; -import org.apache.doris.nereids.trees.expressions.functions.scalar.SubReplace; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Substring; -import org.apache.doris.nereids.trees.expressions.functions.scalar.SubstringIndex; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Tan; -import org.apache.doris.nereids.trees.expressions.functions.scalar.TimeDiff; -import org.apache.doris.nereids.trees.expressions.functions.scalar.TimeToSec; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Timestamp; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ToBase64; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ToBitmap; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ToBitmapWithCheck; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ToDate; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ToDateV2; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ToDays; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ToIpv4; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ToIpv4OrDefault; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ToIpv4OrNull; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ToIpv6; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ToIpv6OrDefault; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ToIpv6OrNull; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ToMonday; -import org.apache.doris.nereids.trees.expressions.functions.scalar.ToQuantileState; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Tokenize; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Trim; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Truncate; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Unhex; -import org.apache.doris.nereids.trees.expressions.functions.scalar.UnixTimestamp; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Upper; -import org.apache.doris.nereids.trees.expressions.functions.scalar.User; -import org.apache.doris.nereids.trees.expressions.functions.scalar.UtcTimestamp; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Uuid; -import org.apache.doris.nereids.trees.expressions.functions.scalar.UuidNumeric; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Version; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Week; -import org.apache.doris.nereids.trees.expressions.functions.scalar.WeekCeil; -import org.apache.doris.nereids.trees.expressions.functions.scalar.WeekFloor; -import org.apache.doris.nereids.trees.expressions.functions.scalar.WeekOfYear; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Weekday; -import org.apache.doris.nereids.trees.expressions.functions.scalar.WeeksAdd; -import org.apache.doris.nereids.trees.expressions.functions.scalar.WeeksDiff; -import org.apache.doris.nereids.trees.expressions.functions.scalar.WeeksSub; -import org.apache.doris.nereids.trees.expressions.functions.scalar.WidthBucket; -import org.apache.doris.nereids.trees.expressions.functions.scalar.Year; -import org.apache.doris.nereids.trees.expressions.functions.scalar.YearCeil; -import org.apache.doris.nereids.trees.expressions.functions.scalar.YearFloor; -import org.apache.doris.nereids.trees.expressions.functions.scalar.YearWeek; -import org.apache.doris.nereids.trees.expressions.functions.scalar.YearsAdd; -import org.apache.doris.nereids.trees.expressions.functions.scalar.YearsDiff; -import org.apache.doris.nereids.trees.expressions.functions.scalar.YearsSub; +import org.apache.doris.nereids.trees.expressions.functions.scalar.*; import com.google.common.collect.ImmutableList; +import org.apache.doris.nereids.trees.expressions.functions.scalar.Database; import java.util.List; @@ -854,6 +446,7 @@ public class BuiltinScalarFunctions implements FunctionHelper { scalar(Unhex.class, "unhex"), scalar(UnixTimestamp.class, "unix_timestamp"), scalar(Upper.class, "ucase", "upper"), + scalar(UrlDecode.class, "url_decode"), scalar(User.class, "user"), scalar(UtcTimestamp.class, "utc_timestamp"), scalar(Uuid.class, "uuid"), diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/UrlDecode.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/UrlDecode.java new file mode 100644 index 00000000000000..63abc9a219602f --- /dev/null +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/UrlDecode.java @@ -0,0 +1,69 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package org.apache.doris.nereids.trees.expressions.functions.scalar; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import org.apache.doris.catalog.FunctionSignature; +import org.apache.doris.nereids.trees.expressions.Expression; +import org.apache.doris.nereids.trees.expressions.functions.AlwaysNullable; +import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature; +import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor; +import org.apache.doris.nereids.types.StringType; +import org.apache.doris.nereids.types.VarcharType; + +import java.util.List; + +/** + * ScalarFunction 'url_decode'. This class is generated by GenerateFunction. + */ +public class UrlDecode extends ScalarFunction + implements ExplicitlyCastableSignature, AlwaysNullable { + + public static final List SIGNATURES = ImmutableList.of( + FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT).args(VarcharType.SYSTEM_DEFAULT), + FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT).args(StringType.INSTANCE) + ); + + /** + * constructor with 1 argument. + */ + public UrlDecode(Expression arg0) { + super("url_decode", arg0); + } + + + /** + * withChildren. + */ + @Override + public UrlDecode withChildren(List children) { + Preconditions.checkArgument(children.size() == 1); + return new UrlDecode(children.get(0)); + } + + @Override + public List getSignatures() { + return SIGNATURES; + } + + @Override + public R accept(ExpressionVisitor visitor, C context) { + return visitor.visitUrlDecode(this, context); + } +} diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/visitor/ScalarFunctionVisitor.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/visitor/ScalarFunctionVisitor.java index 9a1b970b72f6f9..d322e37f053689 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/visitor/ScalarFunctionVisitor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/visitor/ScalarFunctionVisitor.java @@ -398,6 +398,7 @@ import org.apache.doris.nereids.trees.expressions.functions.scalar.Unhex; import org.apache.doris.nereids.trees.expressions.functions.scalar.UnixTimestamp; import org.apache.doris.nereids.trees.expressions.functions.scalar.Upper; +import org.apache.doris.nereids.trees.expressions.functions.scalar.UrlDecode; import org.apache.doris.nereids.trees.expressions.functions.scalar.User; import org.apache.doris.nereids.trees.expressions.functions.scalar.UtcTimestamp; import org.apache.doris.nereids.trees.expressions.functions.scalar.Uuid; @@ -1531,6 +1532,10 @@ default R visitParseUrl(ParseUrl parseUrl, C context) { return visitScalarFunction(parseUrl, context); } + default R visitUrlDecode(UrlDecode urlDecode, C context) { + return visitScalarFunction(urlDecode, context); + } + default R visitPassword(Password password, C context) { return visitScalarFunction(password, context); }