static private BOpFilterBase newDistinctFilter(final AST2BOpContext ctx,final Predicate<?> pred,final DataSetSummary summary,final boolean hashJoin){
  boolean nativeDistinct=hashJoin && ctx.nativeDistinctSPO;
  if (nativeDistinct) {
    final Long rangeCount=(Long)pred.getProperty(Annotations.ESTIMATED_CARDINALITY);
    if (rangeCount != null) {
      if (rangeCount.longValue() < ctx.nativeDistinctSPOThreshold) {
        nativeDistinct=false;
      }
    }
 else {
      log.warn("No rangeCount? : " + pred);
    }
  }
  if (false && nativeDistinct && summary != null) {
    if (summary.nknown < ctx.nativeDistinctSPOThreshold) {
      nativeDistinct=false;
    }
  }
  if (nativeDistinct) {
    @SuppressWarnings({"unchecked","rawtypes"}) final SPOKeyOrder indexKeyOrder=SPOKeyOrder.getKeyOrder((IPredicate)pred,4);
    return NativeDistinctFilter.newInstance(indexKeyOrder);
  }
 else {
    return DistinctFilter.newInstance();
  }
}

static private BOpFilterBase newDistinctFilter ( final AST2BOpContext ctx , final Predicate < ? > pred , final DataSetSummary summary , final boolean hashJoin ) { boolean nativeDistinct = hashJoin && ctx . nativeDistinctSPO ; if ( nativeDistinct ) { final Long rangeCount = ( Long ) pred . getProperty ( Annotations . ESTIMATED_CARDINALITY ) ; if ( rangeCount != null ) { if ( rangeCount . longValue ( ) < ctx . nativeDistinctSPOThreshold ) { nativeDistinct = false ; } } else { log . warn ( "No rangeCount? : " + pred ) ; } } if ( false && nativeDistinct && summary != null ) { if ( summary . nknown < ctx . nativeDistinctSPOThreshold ) { nativeDistinct = false ; } } if ( nativeDistinct ) { @ SuppressWarnings ( { "unchecked" , "rawtypes" } ) final SPOKeyOrder indexKeyOrder = SPOKeyOrder . getKeyOrder ( ( IPredicate ) pred , 4 ) ; return NativeDistinctFilter . newInstance ( indexKeyOrder ) ; } else { return DistinctFilter . newInstance ( ) ; } }
return the distinct filter used for a default graph join ( distinct spos ) . < p > note : the native memory based distinct filter must not be used for pipelined joins . pipelined joins run " as - bound " and the per - as - bound cardinality is typically very small ( 1s to 1000s ) . however , a hash join can hit a very large cardinality for the default graph distinct filter since it sees all spos at once .
