This is an automated email from the ASF dual-hosted git repository.
Jackie-Jiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push:
new 71299210708 Remove redundant snake_case scalar function aliases
(#19984)
71299210708 is described below
commit 7129921070898c54299ffcd5796dc0d423aa7ffd
Author: Xiaotian (Jackie) Jiang <[email protected]>
AuthorDate: Tue Oct 20 21:38:27 2026 -0700
Remove redundant snake_case scalar function aliases (#19984)
---
.../pinot/common/function/scalar/ArithmeticFunctions.java | 2 +-
.../pinot/common/function/scalar/IpAddressFunctions.java | 10 +++++-----
.../apache/pinot/common/function/scalar/StringFunctions.java | 12 ++++++------
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git
a/pinot-common/src/main/java/org/apache/pinot/common/function/scalar/ArithmeticFunctions.java
b/pinot-common/src/main/java/org/apache/pinot/common/function/scalar/ArithmeticFunctions.java
index 9a81f0cf53a..69ee7c117c1 100644
---
a/pinot-common/src/main/java/org/apache/pinot/common/function/scalar/ArithmeticFunctions.java
+++
b/pinot-common/src/main/java/org/apache/pinot/common/function/scalar/ArithmeticFunctions.java
@@ -293,7 +293,7 @@ public class ArithmeticFunctions {
/// @param numBuckets number of equal-width buckets
/// @return bucket number (0 to numBuckets + 1)
/// @throws IllegalArgumentException if lo >= hi or numBuckets <= 0
- @ScalarFunction(names = {"widthBucket", "width_bucket"})
+ @ScalarFunction
public static int widthBucket(double value, double lo, double hi, int
numBuckets) {
if (Double.isNaN(value) || Double.isNaN(lo) || Double.isNaN(hi)) {
throw new IllegalArgumentException("widthBucket does not accept NaN
values");
diff --git
a/pinot-common/src/main/java/org/apache/pinot/common/function/scalar/IpAddressFunctions.java
b/pinot-common/src/main/java/org/apache/pinot/common/function/scalar/IpAddressFunctions.java
index 7825db415eb..6ee5e4b777c 100644
---
a/pinot-common/src/main/java/org/apache/pinot/common/function/scalar/IpAddressFunctions.java
+++
b/pinot-common/src/main/java/org/apache/pinot/common/function/scalar/IpAddressFunctions.java
@@ -248,7 +248,7 @@ public class IpAddressFunctions {
/// @param ipString IP address string (e.g., "192.168.1.1" or "2001:db8::1")
/// @return 4 or 6
/// @throws IllegalArgumentException if the string is not a valid IP address
- @ScalarFunction(names = {"ipFamily", "ip_family"})
+ @ScalarFunction
public static int ipFamily(String ipString) {
IPAddress addr = getAddress(ipString);
return addr.isIPv4() ? 4 : 6;
@@ -259,7 +259,7 @@ public class IpAddressFunctions {
/// @param cidr CIDR string (e.g., "192.168.1.0/24" or "2001:db8::/32")
/// @return the prefix length (e.g., 24)
/// @throws IllegalArgumentException if the input is not a valid CIDR prefix
- @ScalarFunction(names = {"ipMaskLen", "ip_mask_len"})
+ @ScalarFunction
public static int ipMaskLen(String cidr) {
IPAddress prefix = getPrefix(cidr);
return prefix.getNetworkPrefixLength();
@@ -300,7 +300,7 @@ public class IpAddressFunctions {
/// @param cidr CIDR string (e.g., "192.168.1.0/24")
/// @return network mask string (e.g., "255.255.255.0")
/// @throws IllegalArgumentException if the input is not a valid CIDR prefix
- @ScalarFunction(names = {"ipNetmask", "ip_netmask"})
+ @ScalarFunction
public static String ipNetmask(String cidr) {
return buildMask(getPrefix(cidr), false);
}
@@ -310,7 +310,7 @@ public class IpAddressFunctions {
/// @param cidr CIDR string (e.g., "192.168.1.0/24")
/// @return host mask string (e.g., "0.0.0.255")
/// @throws IllegalArgumentException if the input is not a valid CIDR prefix
- @ScalarFunction(names = {"ipHostmask", "ip_hostmask"})
+ @ScalarFunction
public static String ipHostmask(String cidr) {
return buildMask(getPrefix(cidr), true);
}
@@ -329,7 +329,7 @@ public class IpAddressFunctions {
/// @param ipString IP address string without a prefix length (e.g.,
`"192.168.1.1"`)
/// @return `true` if the address is private or reserved
/// @throws IllegalArgumentException if the string is not a valid
non-prefixed IP address
- @ScalarFunction(names = {"isPrivateIp", "is_private_ip"})
+ @ScalarFunction
public static boolean isPrivateIp(String ipString) {
IPAddress ip = getAddress(ipString);
if (ip.isPrefixed()) {
diff --git
a/pinot-common/src/main/java/org/apache/pinot/common/function/scalar/StringFunctions.java
b/pinot-common/src/main/java/org/apache/pinot/common/function/scalar/StringFunctions.java
index bbb73a54e64..8482797325a 100644
---
a/pinot-common/src/main/java/org/apache/pinot/common/function/scalar/StringFunctions.java
+++
b/pinot-common/src/main/java/org/apache/pinot/common/function/scalar/StringFunctions.java
@@ -952,7 +952,7 @@ public class StringFunctions {
/// @param delimiter the delimiter to search for
/// @param count occurrence count (positive = from left, negative = from
right)
/// @return the substring, or the entire input if the delimiter does not
occur enough times
- @ScalarFunction(names = {"substringIndex", "substring_index"})
+ @ScalarFunction
public static String substringIndex(String input, String delimiter, int
count) {
if (count == 0 || delimiter.isEmpty()) {
return "";
@@ -1020,7 +1020,7 @@ public class StringFunctions {
///
/// @param input the input string
/// @return byte length of the UTF-8 encoded string
- @ScalarFunction(names = {"octetLength", "octet_length"})
+ @ScalarFunction
public static int octetLength(String input) {
return input.getBytes(StandardCharsets.UTF_8).length;
}
@@ -1029,7 +1029,7 @@ public class StringFunctions {
///
/// @param input the input string
/// @return bit length of the UTF-8 encoded string
- @ScalarFunction(names = {"bitLength", "bit_length"})
+ @ScalarFunction
public static int bitLength(String input) {
return octetLength(input) * 8;
}
@@ -1039,7 +1039,7 @@ public class StringFunctions {
///
/// @param input the input string
/// @return number of Unicode codepoints
- @ScalarFunction(names = {"charLength", "char_length", "characterLength",
"character_length"})
+ @ScalarFunction(names = {"charLength", "characterLength"})
public static int charLength(String input) {
return input.codePointCount(0, input.length());
}
@@ -1052,7 +1052,7 @@ public class StringFunctions {
/// @param input the input string
/// @param regexp the regular expression pattern
/// @return count of non-overlapping matches
- @ScalarFunction(names = {"regexpCount", "regexp_count"})
+ @ScalarFunction
public static int regexpCount(String input, String regexp) {
Matcher matcher = Pattern.compile(regexp).matcher(input);
int count = 0;
@@ -1071,7 +1071,7 @@ public class StringFunctions {
/// @param regexp the regular expression pattern
/// @return the first matching substring, or null if no match
@Nullable
- @ScalarFunction(names = {"regexpSubstr", "regexp_substr"})
+ @ScalarFunction
public static String regexpSubstr(String input, String regexp) {
Matcher matcher = Pattern.compile(regexp).matcher(input);
return matcher.find() ? matcher.group() : null;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]