Class AggregateProjectionMetadata.Schema

java.lang.Object
org.apache.druid.segment.AggregateProjectionMetadata.Schema
Enclosing class:
AggregateProjectionMetadata

public static class AggregateProjectionMetadata.Schema extends Object
  • Field Details

    • COMPARATOR

      public static final Comparator<AggregateProjectionMetadata.Schema> COMPARATOR
      It is not likely the best way to find the best matching projections, but it is the one we have for now. This comparator is used to sort all the projections in a segment "best" first, where best is defined as fewest grouping columns, most virtual columns and aggregators, as an approximation of likely to have the fewest number of rows to scan.
  • Constructor Details

  • Method Details

    • getName

      public String getName()
    • getTimeColumnName

      @Nullable public String getTimeColumnName()
    • getFilter

      @Nullable public DimFilter getFilter()
    • getVirtualColumns

      public VirtualColumns getVirtualColumns()
    • getGroupingColumns

      public List<String> getGroupingColumns()
    • getAggregators

      public AggregatorFactory[] getAggregators()
    • getOrdering

      public List<OrderBy> getOrdering()
    • getOrderingWithTimeColumnSubstitution

      public List<OrderBy> getOrderingWithTimeColumnSubstitution()
    • getTimeColumnPosition

      public int getTimeColumnPosition()
    • getEffectiveGranularity

      public Granularity getEffectiveGranularity()
    • isInvalidGrouping

      public boolean isInvalidGrouping(@Nullable String columnName)
      Check if a column is either part of groupingColumns, or at least is not present in virtualColumns. Naively, we would just check that grouping column contains the column in question, however, we can also use a projection when a column is truly missing.
      invalid reference
      Projections#matchAggregateProjection(Schema, CursorBuildSpec, Projections.PhysicalColumnChecker)
      returns a match builder if the column is present as either a physical column, or a virtual column, but a virtual column could also be present for an aggregator input, so we must further check that a column not in the grouping list is also not a virtual column, the implication being that it is a missing column.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object