Examples of sampleDesc


Examples of org.apache.hadoop.hive.ql.plan.filterDesc.sampleDesc

        inputs.add(new ReadEntity(part.getTable()));

      // Later the properties have to come from the partition as opposed
      // to from the table in order to support versioning.
      Path paths[];
      sampleDesc sampleDescr = parseCtx.getOpToSamplePruner().get(topOp);

      if (sampleDescr != null) {
        paths = SamplePruner.prune(part, sampleDescr);
      }
      else {
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.filterDesc.sampleDesc

    @Override
    public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx,
        Object... nodeOutputs) throws SemanticException {
      FilterOperator filOp       = (FilterOperator)nd;
      filterDesc     filOpDesc   = filOp.getConf();
      sampleDesc     sampleDescr = filOpDesc.getSampleDescr();

      if ((sampleDescr == null) || !sampleDescr.getInputPruning())
        return null;

      assert stack.size() == 3;
      TableScanOperator tsOp = (TableScanOperator)stack.get(0);
      ((SamplePrunerCtx)procCtx).getOpToSamplePruner().put(tsOp, sampleDescr);
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.filterDesc.sampleDesc

        // input pruning is enough; add the filter for the optimizer to use it later
        LOG.info("No need for sample filter");
        exprNodeDesc samplePredicate = genSamplePredicate(ts, tabBucketCols, colsEqual, alias, rwsch, qb.getMetaData(), null);
        tableOp = OperatorFactory.getAndMakeChild(
          new filterDesc(samplePredicate, true, new sampleDesc(ts.getNumerator(), ts.getDenominator(), tabBucketCols, true)),
          top);
      }
      else {
        // need to add filter
        // create tableOp to be filterDesc and set as child to 'top'
        LOG.info("Need sample filter");
        exprNodeDesc samplePredicate = genSamplePredicate(ts, tabBucketCols, colsEqual, alias, rwsch, qb.getMetaData(), null);
        tableOp = OperatorFactory.getAndMakeChild(
            new filterDesc(samplePredicate, true),
            top);
      }
    }
    else {
      boolean testMode = conf.getBoolVar(HiveConf.ConfVars.HIVETESTMODE);
      if (testMode) {
        String tabName = tab.getName();

        // has the user explicitly asked not to sample this table
        String   unSampleTblList = conf.getVar(HiveConf.ConfVars.HIVETESTMODENOSAMPLE);
        String[] unSampleTbls    = unSampleTblList.split(",");
        boolean unsample = false;
        for (String unSampleTbl : unSampleTbls)
          if (tabName.equalsIgnoreCase(unSampleTbl))
            unsample = true;

        if (!unsample) {
          int numBuckets = tab.getNumBuckets();

          // If the input table is bucketed, choose the first bucket
          if (numBuckets > 0) {
            TableSample tsSample = new TableSample(1, numBuckets);
            tsSample.setInputPruning(true);
            qb.getParseInfo().setTabSample(alias, tsSample);
            exprNodeDesc samplePred = genSamplePredicate(tsSample, tab.getBucketCols(), true, alias, rwsch, qb.getMetaData(), null);
            tableOp = OperatorFactory.getAndMakeChild(
              new filterDesc(samplePred, true,
                             new sampleDesc(tsSample.getNumerator(), tsSample.getDenominator(), tab.getBucketCols(), true)),
              top);
            LOG.info("No need for sample filter");
          }
          // The table is not bucketed, add a dummy filter :: rand()
          else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.