gortiz commented on code in PR #12591: URL: https://github.com/apache/pinot/pull/12591#discussion_r1526626402
########## pinot-common/src/main/java/org/apache/pinot/common/utils/DatabaseUtils.java: ########## @@ -84,4 +84,13 @@ public static String translateTableName(String tableName, HttpHeaders headers, b public static String translateTableName(String tableName, HttpHeaders headers) { return translateTableName(tableName, headers, false); } + + public static boolean isPartOfDatabase(String tableName, @Nullable String databaseName) { + // assumes tableName will not have default database prefix ('default.') + if (StringUtils.isEmpty(databaseName) || databaseName.equalsIgnoreCase(CommonConstants.DEFAULT_DATABASE)) { + return StringUtils.split(tableName, '.').length == 1; Review Comment: Shouldn't be better to do `!tableName.contains(".")`? It has to be faster and doesn't allocate -- 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