@Override public Object process(Node n, Stack<Node> s, NodeProcessorCtx c, Object... os) { ExprNodeDesc expr = ((FilterOperator)n).getConf().getPredicate(); Boolean retval = new Boolean(checkExpression(expr)); if (!retval) { LOG.info("Cannot run filter operator [" + n + "] in llap mode"); } return new Boolean(retval); } });
@Override public Object process(Node n, Stack<Node> s, NodeProcessorCtx c, Object... os) { ExprNodeDesc expr = ((FilterOperator)n).getConf().getPredicate(); Boolean retval = new Boolean(checkExpression(expr)); if (!retval) { LOG.info("Cannot run filter operator [" + n + "] in llap mode"); } return new Boolean(retval); } });
private boolean onlyContainsPartnCols(Table table, Set<FilterOperator> filters) { for (FilterOperator filter : filters) { if (!PartitionPruner.onlyContainsPartnCols(table, filter.getConf().getPredicate())) { return false; } } return true; }
private boolean validateFilterOperator(FilterOperator op) { ExprNodeDesc desc = op.getConf().getPredicate(); return validateExprNodeDesc( desc, "Predicate", VectorExpressionDescriptor.Mode.FILTER, /* allowComplex */ true); }
private boolean onlyContainsPartnCols(Table table, Set<FilterOperator> filters) { for (FilterOperator filter : filters) { if (!PartitionPruner.onlyContainsPartnCols(table, filter.getConf().getPredicate())) { return false; } } return true; }
private boolean validateFilterOperator(FilterOperator op) { ExprNodeDesc desc = op.getConf().getPredicate(); return validateExprNodeDesc(desc, "Predicate", VectorExpressionDescriptor.Mode.FILTER); }
private boolean filterExists(ReduceSinkOperator target, ExprNodeDesc replaced) { Operator<?> operator = target.getParentOperators().get(0); for (; operator instanceof FilterOperator; operator = operator.getParentOperators().get(0)) { ExprNodeDesc predicate = ((FilterOperator) operator).getConf().getPredicate(); if (ExprNodeDescUtils.containsPredicate(predicate, replaced)) { return true; } } return false; } }
private boolean filterExists(ReduceSinkOperator target, ExprNodeDesc replaced) { Operator<?> operator = target.getParentOperators().get(0); for (; operator instanceof FilterOperator; operator = operator.getParentOperators().get(0)) { ExprNodeDesc predicate = ((FilterOperator) operator).getConf().getPredicate(); if (ExprNodeDescUtils.containsPredicate(predicate, replaced)) { return true; } } return false; } }
@Override public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx, Object... nodeOutputs) throws SemanticException { FilterOperator filterOp = (FilterOperator) nd; ExprNodeDesc predicate = filterOp.getConf().getPredicate(); // Generate the list bucketing pruning predicate ExprNodeDesc newPredicate = generateInClause(predicate); if (newPredicate != null) { // Replace filter in current FIL with new FIL if (LOG.isDebugEnabled()) { LOG.debug("Generated new predicate with IN clause: " + newPredicate); } filterOp.getConf().setPredicate(newPredicate); } return null; }
@Override public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx ctx, Object... nodeOutputs) throws SemanticException { FilterOperator op = (FilterOperator) nd; ColumnPrunerProcCtx cppCtx = (ColumnPrunerProcCtx) ctx; ExprNodeDesc condn = op.getConf().getPredicate(); List<FieldNode> filterOpPrunedColLists = mergeFieldNodesWithDesc(cppCtx.genColLists(op), condn); List<FieldNode> filterOpPrunedColListsOrderPreserved = preserveColumnOrder(op, filterOpPrunedColLists); cppCtx.getPrunedColLists().put(op, filterOpPrunedColListsOrderPreserved); pruneOperator(cppCtx, op, cppCtx.getPrunedColLists().get(op)); cppCtx.handleFilterUnionChildren(op); return null; } }
public static Operator<? extends OperatorDesc> vectorizeFilterOperator( Operator<? extends OperatorDesc> filterOp, VectorizationContext vContext, VectorFilterDesc vectorFilterDesc) throws HiveException { FilterDesc filterDesc = (FilterDesc) filterOp.getConf(); ExprNodeDesc predicateExpr = filterDesc.getPredicate(); VectorExpression vectorPredicateExpr = vContext.getVectorExpression(predicateExpr, VectorExpressionDescriptor.Mode.FILTER); vectorFilterDesc.setPredicateExpression(vectorPredicateExpr); return OperatorFactory.getVectorOperator( filterOp.getCompilationOpContext(), filterDesc, vContext, vectorFilterDesc); }
@Override protected void generatePredicate(NodeProcessorCtx procCtx, FilterOperator fop, TableScanOperator top) throws SemanticException, UDFArgumentException { OpWalkerCtx owc = (OpWalkerCtx) procCtx; // Otherwise this is not a sampling predicate and we need to ExprNodeDesc predicate = fop.getConf().getPredicate(); String alias = top.getConf().getAlias(); // Generate the partition pruning predicate ExprNodeDesc ppr_pred = ExprProcFactory.genPruner(alias, predicate); // Add the pruning predicate to the table scan operator addPruningPred(owc.getOpToPartPruner(), top, ppr_pred); }
@Override protected void generatePredicate(NodeProcessorCtx procCtx, FilterOperator fop, TableScanOperator top) throws SemanticException, UDFArgumentException { OpWalkerCtx owc = (OpWalkerCtx) procCtx; // Otherwise this is not a sampling predicate and we need to ExprNodeDesc predicate = fop.getConf().getPredicate(); String alias = top.getConf().getAlias(); // Generate the partition pruning predicate ExprNodeDesc ppr_pred = ExprProcFactory.genPruner(alias, predicate); // Add the pruning predicate to the table scan operator addPruningPred(owc.getOpToPartPruner(), top, ppr_pred); }
public static Operator<? extends OperatorDesc> vectorizeFilterOperator( Operator<? extends OperatorDesc> filterOp, VectorizationContext vContext) throws HiveException { FilterDesc filterDesc = (FilterDesc) filterOp.getConf(); VectorFilterDesc vectorFilterDesc = new VectorFilterDesc(); filterDesc.setVectorDesc(vectorFilterDesc); ExprNodeDesc predicateExpr = filterDesc.getPredicate(); VectorExpression vectorPredicateExpr = vContext.getVectorExpression(predicateExpr, VectorExpressionDescriptor.Mode.FILTER); vectorFilterDesc.setPredicateExpression(vectorPredicateExpr); return OperatorFactory.getVectorOperator( filterOp.getCompilationOpContext(), filterDesc, vContext, filterOp); }
@Override public Object clone() { FilterDesc filterDesc = new FilterDesc(getPredicate().clone(), getIsSamplingPred()); if (getIsSamplingPred()) { filterDesc.setSampleDescr(getSampleDescr()); } filterDesc.setSortedFilter(isSortedFilter()); return filterDesc; }
@Override protected void initializeOp(Configuration hconf) throws HiveException { super.initializeOp(hconf); try { heartbeatInterval = HiveConf.getIntVar(hconf, HiveConf.ConfVars.HIVESENDHEARTBEAT); conditionEvaluator = ExprNodeEvaluatorFactory.get(conf.getPredicate(), hconf); if (HiveConf.getBoolVar(hconf, HiveConf.ConfVars.HIVEEXPREVALUATIONCACHE)) { conditionEvaluator = ExprNodeEvaluatorFactory.toCachedEval(conditionEvaluator); } conditionInspector = null; ioContext = IOContextMap.get(hconf); } catch (Throwable e) { throw new HiveException(e); } }
@Override protected void generatePredicate(NodeProcessorCtx procCtx, FilterOperator fop, TableScanOperator top) throws SemanticException, UDFArgumentException { LBOpWalkerCtx owc = (LBOpWalkerCtx) procCtx; // Otherwise this is not a sampling predicate and we need to ExprNodeDesc predicate = fop.getConf().getPredicate(); String alias = top.getConf().getAlias(); // Generate the list bucketing pruning predicate ExprNodeDesc lbprPred = LBExprProcFactory.genPruner(alias, predicate, owc.getPart()); /* * add list bucketing predicate to to the table scan operator */ addPruningPred(owc.getOpToPartToLBPruner(), top, lbprPred, owc.getPart()); }
@Override public Object clone() { FilterDesc filterDesc = new FilterDesc(getPredicate().clone(), getIsSamplingPred()); if (getIsSamplingPred()) { filterDesc.setSampleDescr(getSampleDescr()); } filterDesc.setSortedFilter(isSortedFilter()); return filterDesc; }
@Override protected void initializeOp(Configuration hconf) throws HiveException { super.initializeOp(hconf); try { heartbeatInterval = HiveConf.getIntVar(hconf, HiveConf.ConfVars.HIVESENDHEARTBEAT); conditionEvaluator = ExprNodeEvaluatorFactory.get(conf.getPredicate(), hconf); if (HiveConf.getBoolVar(hconf, HiveConf.ConfVars.HIVEEXPREVALUATIONCACHE)) { conditionEvaluator = ExprNodeEvaluatorFactory.toCachedEval(conditionEvaluator); } conditionInspector = null; ioContext = IOContextMap.get(hconf); } catch (Throwable e) { throw new HiveException(e); } }
@Override protected void generatePredicate(NodeProcessorCtx procCtx, FilterOperator fop, TableScanOperator top) throws SemanticException, UDFArgumentException { LBOpWalkerCtx owc = (LBOpWalkerCtx) procCtx; // Otherwise this is not a sampling predicate and we need to ExprNodeDesc predicate = fop.getConf().getPredicate(); String alias = top.getConf().getAlias(); // Generate the list bucketing pruning predicate ExprNodeDesc lbprPred = LBExprProcFactory.genPruner(alias, predicate, owc.getPart()); /* * add list bucketing predicate to to the table scan operator */ addPruningPred(owc.getOpToPartToLBPruner(), top, lbprPred, owc.getPart()); }