@Nullable
  private static DimFilter toLeafFilter(
      final PlannerContext plannerContext,
      final DruidQuerySignature querySignature,
      final RexNode rexNode
  )
  {
    if (rexNode.isAlwaysTrue()) {
      return Filtration.matchEverything();
    } else if (rexNode.isAlwaysFalse()) {
      return Filtration.matchNothing();
    }

    final DimFilter simpleFilter = toSimpleLeafFilter(
        plannerContext,
        querySignature,
        rexNode
    );
    return simpleFilter != null
           ? simpleFilter
           : toExpressionLeafFilter(plannerContext, querySignature.getRowSignature(), rexNode);
  }
@ Nullable private static DimFilter toLeafFilter ( final PlannerContext plannerContext , final DruidQuerySignature querySignature , final RexNode rexNode ) { if ( rexNode . isAlwaysTrue ( ) ) { return Filtration . matchEverything ( ) ; } else if ( rexNode . isAlwaysFalse ( ) ) { return Filtration . matchNothing ( ) ; } final DimFilter simpleFilter = toSimpleLeafFilter ( plannerContext , querySignature , rexNode ) ; return simpleFilter != null ? simpleFilter : toExpressionLeafFilter ( plannerContext , querySignature . getRowSignature ( ) , rexNode ) ; }
Translates "condition" to a Druid filter, assuming it does not contain any boolean expressions. Returns null
if we cannot translate the condition.

@param plannerContext planner context
@param querySignature   row signature of the dataSource to be filtered
@param rexNode        Calcite row expression