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 Details

    • JoinPrefixUtils

      public JoinPrefixUtils()
  • Method Details

    • validatePrefix

      public static String validatePrefix(@Nullable String prefix)
      Checks that "prefix" is a valid prefix for a join clause (see JoinableClause.getPrefix()) and, if so, returns it. Otherwise, throws an exception.
    • isPrefixedBy

      public static boolean isPrefixedBy(String columnName, String prefix)
    • unprefix

      public static String unprefix(String columnName, String prefix)
      Removes the prefix on columnName. Must only be called if the column name is actually prefixed; i.e., if isPrefixedBy(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.