Package org.apache.druid.segment.join
Class JoinPrefixUtils
java.lang.Object
org.apache.druid.segment.join.JoinPrefixUtils
Utility class for working with prefixes in join operations
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckPrefixesForDuplicatesAndShadowing(List<String> prefixes) Check if any prefixes in the provided list duplicate or shadow each other.static booleanisPrefixedBy(String columnName, String prefix) static StringRemoves 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.
-
Constructor Details
-
JoinPrefixUtils
public JoinPrefixUtils()
-
-
Method Details
-
validatePrefix
Checks that "prefix" is a valid prefix for a join clause (seeJoinableClause.getPrefix()) and, if so, returns it. Otherwise, throws an exception. -
isPrefixedBy
-
unprefix
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
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.
-