gortiz commented on code in PR #14435: URL: https://github.com/apache/pinot/pull/14435#discussion_r1840261002
########## pinot-common/src/main/java/org/apache/pinot/common/function/scalar/DataTypeConversionFunctions.java: ########## @@ -129,4 +129,27 @@ public static byte[] base64Encode(byte[] input) { public static byte[] base64Decode(byte[] input) { return Base64.getDecoder().decode(input); } + + /** + * Converts a hex string to the corresponded long value. + * @param input hex decimal string + * @return decoded long value + */ + @ScalarFunction + public static long hexDecimalToLong(String input) { + if (input.startsWith("0x")) { + input = input.substring(2); + } + return Long.parseLong(input, 16); Review Comment: Tip: You can call `public static long parseLong(CharSequence s, int beginIndex, int endIndex, int radix)` instead allocating a new string here. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org