@Override public boolean isSame(OperatorDesc other) { if (getClass().getName().equals(other.getClass().getName())) { TableScanDesc otherDesc = (TableScanDesc) other; return Objects.equals(getQualifiedTable(), otherDesc.getQualifiedTable()) && ExprNodeDescUtils.isSame(getFilterExpr(), otherDesc.getFilterExpr()) && getRowLimit() == otherDesc.getRowLimit() && isGatherStats() == otherDesc.isGatherStats(); } return false; }
private void cleanTableScanFilters(TableScanOperator ts) throws SemanticException { if (ts == null || ts.getConf() == null || ts.getConf().getFilterExpr() == null) { // nothing to do return; } DynamicPartitionPrunerContext removerContext = new DynamicPartitionPrunerContext(); // collect the dynamic pruning conditions removerContext.dynLists.clear(); GenTezUtils.collectDynamicPruningConditions(ts.getConf().getFilterExpr(), removerContext); for (DynamicListContext ctx : removerContext) { // remove the condition by replacing it with "true" ExprNodeDesc constNode = new ExprNodeConstantDesc(ctx.parent.getTypeInfo(), true); if (ctx.grandParent == null) { // we're the only node, just clear out the expression ts.getConf().setFilterExpr(null); } else { int i = ctx.grandParent.getChildren().indexOf(ctx.parent); ctx.grandParent.getChildren().remove(i); ctx.grandParent.getChildren().add(i, constNode); } } }
@Override public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx ctx, Object... nodeOutputs) throws SemanticException { TableScanOperator op = (TableScanOperator) nd; TableScanDesc conf = op.getConf(); ConstantPropagateProcCtx cppCtx = (ConstantPropagateProcCtx) ctx; Map<ColumnInfo, ExprNodeDesc> constants = cppCtx.getPropagatedConstants(op); cppCtx.getOpToConstantExprs().put(op, constants); ExprNodeGenericFuncDesc pred = conf.getFilterExpr(); if (pred == null) { return null; } ExprNodeDesc constant = foldExpr(pred, constants, cppCtx, op, 0, false); if (constant instanceof ExprNodeGenericFuncDesc) { conf.setFilterExpr((ExprNodeGenericFuncDesc) constant); } else { conf.setFilterExpr(null); } return null; } }
ts.getConf() == null ? null : ts.getConf().getFilterExpr();
private void cleanTableScanFilters(TableScanOperator ts) throws SemanticException { if (ts == null || ts.getConf() == null || ts.getConf().getFilterExpr() == null) { // nothing to do return; } DynamicPartitionPrunerContext removerContext = new DynamicPartitionPrunerContext(); // collect the dynamic pruning conditions removerContext.dynLists.clear(); collectDynamicPruningConditions(ts.getConf().getFilterExpr(), removerContext); for (DynamicListContext ctx : removerContext) { // remove the condition by replacing it with "true" ExprNodeDesc constNode = new ExprNodeConstantDesc(ctx.parent.getTypeInfo(), true); if (ctx.grandParent == null) { // we're the only node, just clear out the expression ts.getConf().setFilterExpr(null); } else { int i = ctx.grandParent.getChildren().indexOf(ctx.parent); ctx.grandParent.getChildren().remove(i); ctx.grandParent.getChildren().add(i, constNode); } } }
@Override public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx ctx, Object... nodeOutputs) throws SemanticException { TableScanOperator op = (TableScanOperator) nd; TableScanDesc conf = op.getConf(); ConstantPropagateProcCtx cppCtx = (ConstantPropagateProcCtx) ctx; Map<ColumnInfo, ExprNodeDesc> constants = cppCtx.getPropagatedConstants(op); cppCtx.getOpToConstantExprs().put(op, constants); ExprNodeGenericFuncDesc pred = conf.getFilterExpr(); if (pred == null) { return null; } ExprNodeDesc constant = foldExpr(pred, constants, cppCtx, op, 0, false); if (constant instanceof ExprNodeGenericFuncDesc) { conf.setFilterExpr((ExprNodeGenericFuncDesc) constant); } else { conf.setFilterExpr(null); } return null; } }
ts.getConf() == null ? null : ts.getConf().getFilterExpr();
if (ts.getConf() != null && ts.getConf().getFilterExpr() != null) { if (LOG.isDebugEnabled()) { LOG.debug("Serializing: " + ts.getConf().getFilterExpr().getExprString()); SerializationUtilities.serializeExpression(ts.getConf().getFilterExpr()));
if (ts.getConf() != null && ts.getConf().getFilterExpr() != null) { if (LOG.isDebugEnabled()) { LOG.debug("Serializing: " + ts.getConf().getFilterExpr().getExprString()); SerializationUtilities.serializeExpression(ts.getConf().getFilterExpr()));
ExprNodeDesc predicate = operatorDesc.getFilterExpr();
if (ts.getConf().getFilterExpr() != null) { collectDynamicValuePredicates(ts.getConf().getFilterExpr(), filterDynamicValuePredicatesCollection); for (ExprNodeDesc nodeToRemove : filterDynamicValuePredicatesCollection
@Override public boolean equals(TableScanOperator op1, TableScanOperator op2) { Preconditions.checkNotNull(op1); Preconditions.checkNotNull(op2); TableScanDesc op1Conf = op1.getConf(); TableScanDesc op2Conf = op2.getConf(); if (compareString(op1Conf.getAlias(), op2Conf.getAlias()) && compareExprNodeDesc(op1Conf.getFilterExpr(), op2Conf.getFilterExpr()) && op1Conf.getRowLimit() == op2Conf.getRowLimit() && op1Conf.isGatherStats() == op2Conf.isGatherStats()) { return true; } else { return false; } } }
if (ts.getConf().getFilterExpr() != null) { collectDynamicPruningConditions( ts.getConf().getFilterExpr(), filterDynamicListPredicatesCollection); for (DynamicListContext ctx : filterDynamicListPredicatesCollection) { if (ctx.generator != dped.getGenerator()) {
collect(desc.getPredicate(), removalContext); CollectContext tsRemovalContext = new CollectContext(); collect(ts.getConf().getFilterExpr(), tsRemovalContext);
Utilities.setColumnTypeList(jobConf, tableScan); ExprNodeGenericFuncDesc filterExpr = (ExprNodeGenericFuncDesc)scanDesc.getFilterExpr(); if (filterExpr == null) { return;
Utilities.setColumnTypeList(jobConf, tableScan); ExprNodeGenericFuncDesc filterExpr = (ExprNodeGenericFuncDesc)scanDesc.getFilterExpr(); if (filterExpr == null) { return;
collect(desc.getPredicate(), removalContext); CollectContext tsRemovalContext = new CollectContext(); collect(ts.getConf().getFilterExpr(), tsRemovalContext);
if (semiJoin && ts.getConf().getFilterExpr() != null) { LOG.debug("Initiate semijoin reduction for " + column);
ExprNodeGenericFuncDesc filter = top.getConf().getFilterExpr(); if (filter == null) { return;
private static void pushFilterToTopOfTableScan( SharedWorkOptimizerCache optimizerCache, TableScanOperator tsOp) throws UDFArgumentException { ExprNodeGenericFuncDesc tableScanExprNode = tsOp.getConf().getFilterExpr(); List<Operator<? extends OperatorDesc>> allChildren = Lists.newArrayList(tsOp.getChildOperators());