Package org.apache.hadoop.hive.ql.optimizer.optiq.HiveOptiqUtil

Examples of org.apache.hadoop.hive.ql.optimizer.optiq.HiveOptiqUtil.JoinPredicateInfo


          new FilterSelectivityEstimator(j).
          estimateSelectivity(predInfo.getValue());
    }

    RexNode combinedPredicate = predInfo.getValue();
    JoinPredicateInfo jpi = JoinPredicateInfo.constructJoinPredicateInfo(j,
        combinedPredicate);
    ImmutableMap.Builder<Integer, Double> colStatMapBuilder = ImmutableMap
        .builder();
    ImmutableMap<Integer, Double> colStatMap;
    int rightOffSet = j.getLeft().getRowType().getFieldCount();

    // 1. Update Col Stats Map with col stats for columns from left side of
    // Join which are part of join keys
    for (Integer ljk : jpi.getProjsFromLeftPartOfJoinKeysInChildSchema()) {
      colStatMapBuilder.put(ljk,
          HiveRelMdDistinctRowCount.getDistinctRowCount(j.getLeft(), ljk));
    }

    // 2. Update Col Stats Map with col stats for columns from right side of
    // Join which are part of join keys
    for (Integer rjk : jpi.getProjsFromRightPartOfJoinKeysInChildSchema()) {
      colStatMapBuilder.put(rjk + rightOffSet,
          HiveRelMdDistinctRowCount.getDistinctRowCount(j.getRight(), rjk));
    }
    colStatMap = colStatMapBuilder.build();

    // 3. Walk through the Join Condition Building NDV for selectivity
    // NDV of the join can not exceed the cardinality of cross join.
    List<JoinLeafPredicateInfo> peLst = jpi.getEquiJoinPredicateElements();
    int noOfPE = peLst.size();
    if (noOfPE > 0) {
      ndvCrossProduct = exponentialBackoff(peLst, colStatMap);

      if (j.isLeftSemiJoin())
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.ql.optimizer.optiq.HiveOptiqUtil.JoinPredicateInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.