processing/src/main/java/org/apache/druid/query/groupby/GroupByQueryQueryToolChest.java
/**
   * This function checks the query for dimensions which can be optimized by applying the dimension extraction
   * as the final step of the query instead of on every event.
   *
   * @param query The query to check for optimizations
   *
   * @return The set of dimensions (as offsets into {@code query.getDimensions()}) which can be extracted at the last
   * second upon query completion.
   */
This function checks the query for dimensions which can be optimized by applying the dimension extraction
as the final step of the query instead of on every event.

@param query The query to check for optimizations

@return The set of dimensions (as offsets into  query.getDimensions()) which can be extracted at the last
second upon query completion.
This function checks the query for dimensions which can be optimized by applying the dimension extraction as the final step of the query instead of on every event . @param query The query to check for optimizations @return The set of dimensions ( as offsets into query . getDimensions () ) which can be extracted at the last second upon query completion .
private static BitSet extractionsToRewrite(GroupByQuery query)
  {
    final BitSet retVal = new BitSet();
    final List<DimensionSpec> dimensions = query.getDimensions();
    for (int i = 0; i < dimensions.size(); i++) {
      final DimensionSpec dimensionSpec = dimensions.get(i);
      if (dimensionSpec.getExtractionFn() != null
          && ExtractionFn.ExtractionType.ONE_TO_ONE.equals(dimensionSpec.getExtractionFn().getExtractionType())) {
        retVal.set(i);
      }
    }
    return retVal;
  }
private static BitSet extractionsToRewrite ( GroupByQuery query ) { final BitSet retVal = new BitSet ( ) ; final List < DimensionSpec > dimensions = query . getDimensions ( ) ; for ( int i = 0 ; i < dimensions . size ( ) ; i ++ ) { final DimensionSpec dimensionSpec = dimensions . get ( i ) ; if ( dimensionSpec . getExtractionFn ( ) != null && ExtractionFn . ExtractionType . ONE_TO_ONE . equals ( dimensionSpec . getExtractionFn ( ) . getExtractionType ( ) ) ) { retVal . set ( i ) ; } } return retVal ; }
This function checks the query for dimensions which can be optimized by applying the dimension extraction
 as the final step of the query instead of on every event.
This function checks the query for dimensions which can be optimized by applying the dimension extraction as the final step of the query instead of on every event .