Class LocalProperties

java.lang.Object
io.trino.sql.planner.optimizations.LocalProperties

public final class LocalProperties extends Object
  • Method Details

    • none

      public static <T> List<LocalProperty<T>> none()
    • grouped

      public static <T> List<LocalProperty<T>> grouped(Collection<T> columns)
    • stripLeadingConstants

      public static <T> List<LocalProperty<T>> stripLeadingConstants(List<? extends LocalProperty<T>> properties)
    • extractLeadingConstants

      public static <T> Set<T> extractLeadingConstants(List<? extends LocalProperty<T>> properties)
    • translate

      public static <X, Y> List<LocalProperty<Y>> translate(List<? extends LocalProperty<X>> properties, Function<X,Optional<Y>> translator)
      Translates the properties as much as possible, and truncates at the first non-translatable property
    • match

      public static <T> List<Optional<LocalProperty<T>>> match(List<LocalProperty<T>> actuals, List<LocalProperty<T>> desired)
      Attempt to match the desired properties to a sequence of known properties.

      Returns a list of the same length as the original. Entries are: - Optional.empty(): the property was satisfied completely - non-empty: the (simplified) property that was not satisfied

    • normalizeAndPrune

      public static <T> List<LocalProperty<T>> normalizeAndPrune(List<? extends LocalProperty<T>> localProperties)
      Normalizes the local properties and potentially consolidates it to the smallest possible list NOTE: When normalized, each symbol will only appear once
    • normalize

      public static <T> List<Optional<LocalProperty<T>>> normalize(List<? extends LocalProperty<T>> localProperties)
      Normalizes the local properties by removing redundant symbols, but retains the original local property positions