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 void
checkPrefixesForDuplicatesAndShadowing(List<String> prefixes)
Check if any prefixes in the provided list duplicate or shadow each other.static boolean
isPrefixedBy(String columnName, String prefix)
static String
unprefix(String columnName, String prefix)
Removes the prefix oncolumnName
.static String
validatePrefix(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.
-
-