clintropolis commented on a change in pull request #7388: Support LPAD and RPAD sql function URL: https://github.com/apache/incubator-druid/pull/7388#discussion_r271466221
########## File path: core/src/main/java/org/apache/druid/java/util/common/StringUtils.java ########## @@ -360,4 +360,93 @@ public static String encodeBase64String(byte[] input) { return BASE64_DECODER.decode(input); } + + /** + * Returns the string left-padded with the string pad to a length of len characters. + * If str is longer than len, the return value is shortened to len characters. + * + * @param base The base string to be padded + * @param len The length of padded string + * @param pad The pad string + * @return the string left-padded with pad to a lenght of len + */ + public static String lpad(String base, Integer len, String pad) Review comment: I believe guava and commons-lang also have string padding functions, how do these compare to those implementations? (Not a suggestion to use either of those, just curious about the choice) ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org