/** * 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 rowSignature row signature of the dataSource to be filtered * @param rexNode Calcite row expression */ @Nullable private static DimFilter toLeafFilter( final PlannerContext plannerContext, final RowSignature rowSignature, final RexNode rexNode ) { if (rexNode.isAlwaysTrue()) { return Filtration.matchEverything(); } else if (rexNode.isAlwaysFalse()) { return Filtration.matchNothing(); } final DimFilter simpleFilter = toSimpleLeafFilter(plannerContext, rowSignature, rexNode); return simpleFilter != null ? simpleFilter : toExpressionLeafFilter(plannerContext, rowSignature, rexNode); }
return toSimpleLeafFilter( plannerContext, rowSignature, } else if (kind == SqlKind.IS_FALSE || kind == SqlKind.IS_NOT_TRUE) { return new NotDimFilter( toSimpleLeafFilter( plannerContext, rowSignature,
/** * 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 rowSignature row signature of the dataSource to be filtered * @param rexNode Calcite row expression */ @Nullable private static DimFilter toLeafFilter( final PlannerContext plannerContext, final RowSignature rowSignature, final RexNode rexNode ) { if (rexNode.isAlwaysTrue()) { return Filtration.matchEverything(); } else if (rexNode.isAlwaysFalse()) { return Filtration.matchNothing(); } final DimFilter simpleFilter = toSimpleLeafFilter(plannerContext, rowSignature, rexNode); return simpleFilter != null ? simpleFilter : toExpressionLeafFilter(plannerContext, rowSignature, rexNode); }
return toSimpleLeafFilter( plannerContext, rowSignature, } else if (kind == SqlKind.IS_FALSE || kind == SqlKind.IS_NOT_TRUE) { return new NotDimFilter( toSimpleLeafFilter( plannerContext, rowSignature,