@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; } }
@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; } }
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); } } }
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); } } }
private Operator<TableScanDesc> getTsOp(int i) { Table tblMetadata = new Table("db", "table"); TableScanDesc desc = new TableScanDesc("alias"/*+ cCtx.nextOperatorId()*/, tblMetadata); List<ExprNodeDesc> as = Lists.newArrayList(new ExprNodeConstantDesc(TypeInfoFactory.intTypeInfo, Integer.valueOf(i)), new ExprNodeColumnDesc(TypeInfoFactory.intTypeInfo, "c1", "aa", false)); ExprNodeGenericFuncDesc f1 = new ExprNodeGenericFuncDesc(TypeInfoFactory.intTypeInfo, udf, as); desc.setFilterExpr(f1); Operator<TableScanDesc> ts = OperatorFactory.get(cCtx, desc); return ts; }
tableScanDesc.setFilterExpr(originalPredicate); tableScanDesc.setFilterExpr(originalPredicate); return originalPredicate; tableScanDesc.setFilterExpr(decomposed.pushedPredicate); tableScanDesc.setFilterObject(decomposed.pushedPredicateObject);
tableScanDesc.setFilterExpr(originalPredicate); tableScanDesc.setFilterExpr(originalPredicate); return originalPredicate; tableScanDesc.setFilterExpr(decomposed.pushedPredicate); tableScanDesc.setFilterObject(decomposed.pushedPredicateObject);
if (nodeParent == null) { ts.getConf().setFilterExpr(null); } else { int i = nodeParent.getChildren().indexOf(nodeToRemove);
if (tsChild.isSame(child)) { if (tsParent == null) { ts.getConf().setFilterExpr(null); } else { int i = tsParent.getChildren().indexOf(tsChild);
retainableTsOp.getConf().setFilterExpr(exprNode);
private Operator<TableScanDesc> getTsOp(int i) { Table tblMetadata = new Table("db", "table"); TableScanDesc desc = new TableScanDesc("alias_" + cCtx.nextOperatorId(), tblMetadata); List<ExprNodeDesc> as = Lists.newArrayList(new ExprNodeConstantDesc(TypeInfoFactory.intTypeInfo, Integer.valueOf(i)), new ExprNodeColumnDesc(TypeInfoFactory.intTypeInfo, "c1", "aa", false)); ExprNodeGenericFuncDesc f1 = new ExprNodeGenericFuncDesc(TypeInfoFactory.intTypeInfo, udf, as); desc.setFilterExpr(f1); Operator<TableScanDesc> ts = OperatorFactory.get(cCtx, desc); return ts; }
if (tsChild.isSame(child)) { if (tsParent == null) { ts.getConf().setFilterExpr(null); } else { int i = tsParent.getChildren().indexOf(tsChild);
ts.getConf().setFilterExpr(null); } else { int i = ctx.grandParent.getChildren().indexOf(ctx.parent);
@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; } }
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(); walkExprTree(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); } } }
tableScanDesc.setFilterExpr(originalPredicate); return originalPredicate; tableScanDesc.setFilterExpr(decomposed.pushedPredicate); return decomposed.residualPredicate;
tableScanDesc.setFilterExpr(originalPredicate); tableScanDesc.setFilterExpr(originalPredicate); return originalPredicate; tableScanDesc.setFilterExpr(decomposed.pushedPredicate); tableScanDesc.setFilterObject(decomposed.pushedPredicateObject);