Package org.apache.druid.segment.join
Class JoinPrefixUtils
- java.lang.Object
-
- org.apache.druid.segment.join.JoinPrefixUtils
-
public class JoinPrefixUtils extends Object
Utility class for working with prefixes in join operations
-
-
Constructor Summary
Constructors Constructor Description JoinPrefixUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcheckPrefixesForDuplicatesAndShadowing(List<String> prefixes)Check if any prefixes in the provided list duplicate or shadow each other.static booleanisPrefixedBy(String columnName, String prefix)static Stringunprefix(String columnName, String prefix)Removes the prefix oncolumnName.static StringvalidatePrefix(String prefix)Checks that "prefix" is a valid prefix for a join clause (seeJoinableClause.getPrefix()) and, if so, returns it.
-
-
-
Method Detail
-
validatePrefix
public static String validatePrefix(@Nullable String prefix)
Checks that "prefix" is a valid prefix for a join clause (seeJoinableClause.getPrefix()) and, if so, returns it. Otherwise, throws an exception.
-
unprefix
public static String unprefix(String columnName, String prefix)
Removes the prefix oncolumnName. Must only be called if the column name is actually prefixed; i.e., ifisPrefixedBy(String, String)would return true on the same arguments.- Throws:
IllegalArgumentException- if columnName does not start with prefix
-
checkPrefixesForDuplicatesAndShadowing
public static void checkPrefixesForDuplicatesAndShadowing(List<String> prefixes)
Check if any prefixes in the provided list duplicate or shadow each other.- Parameters:
prefixes- A mutable list containing the prefixes to check. This list will be sorted by descending string length.
-
-