int[][] targets = getTargets(join); List<ExprNodeDesc> newExprs = createDerivatives(target.getParentOperators().get(0), targetKeys.get(i), sourceKey); if (!newExprs.isEmpty()) { if (LOG.isDebugEnabled()) { if (getFuncText(funcDesc.getFuncText(), 1) == null) { ExprNodeDesc sourceKey = getRSColExprFromResidualFilter(sourceChild, join); funcArgs.add(sourceKey); final ExprNodeDynamicListDesc dynamicExpr = new ExprNodeDynamicListDesc(targetChild.getTypeInfo(), target, 0, getRSColExprFromResidualFilter(targetChild, join)); funcArgs.add(dynamicExpr); ExprNodeDesc funcExpr = ExprNodeGenericFuncDesc.newInstance(FunctionRegistry.getFunctionInfo(getFuncText(funcDesc.getFuncText(), srcPos)).getGenericUDF(), funcArgs);
int[][] targets = getTargets(join);
@Override public ParseContext transform(ParseContext pctx) throws SemanticException { if (!pctx.getConf().getVar(ConfVars.HIVE_EXECUTION_ENGINE).equals("tez") || !pctx.getConf().getBoolVar(ConfVars.TEZ_DYNAMIC_PARTITION_PRUNING)) { return pctx; } Map<Rule, NodeProcessor> opRules = new LinkedHashMap<Rule, NodeProcessor>(); opRules.put(new RuleRegExp("R1", "(" + TableScanOperator.getOperatorName() + "%" + ".*" + ReduceSinkOperator.getOperatorName() + "%" + JoinOperator.getOperatorName() + "%)"), new JoinSynthetic()); // The dispatcher fires the processor corresponding to the closest matching // rule and passes the context along SyntheticContext context = new SyntheticContext(pctx); Dispatcher disp = new DefaultRuleDispatcher(null, opRules, context); GraphWalker ogw = new PreOrderWalker(disp); // Create a list of top op nodes List<Node> topNodes = new ArrayList<Node>(); topNodes.addAll(pctx.getTopOps().values()); ogw.startWalking(topNodes, null); return pctx; }
final int[][] targets = getTargets(joinOp); final ReduceSinkOperator rsOp = (ReduceSinkOperator) joinOp.getParentOperators().get(srcPos); addParentReduceSink(resultExprs, rsOp, posInRSOpKeys, sourceKey); for (int targetPos: targets[srcPos]) { if (srcPos == targetPos) { final Operator<?> otherRsOpInput = otherRsOp.getParentOperators().get(0); addParentReduceSink(resultExprs, otherRsOp, posInRSOpKeys, sourceKey); boolean success = createDerivatives( resultExprs, otherRsOpInput, otherRsOp.getConf().getKeyCols().get(posInRSOpKeys), sourceKey); if (!success) { boolean success = createDerivatives( resultExprs, rsOpInput, rsOpInputExprNode, sourceKey); if (!success) {
int[][] targets = getTargets(join);
@Override public ParseContext transform(ParseContext pctx) throws SemanticException { boolean enabled = false; String queryEngine = pctx.getConf().getVar(ConfVars.HIVE_EXECUTION_ENGINE); if (queryEngine.equals("tez") && pctx.getConf().getBoolVar(ConfVars.TEZ_DYNAMIC_PARTITION_PRUNING)) { enabled = true; } else if ((queryEngine.equals("spark") && pctx.getConf().getBoolVar(ConfVars.SPARK_DYNAMIC_PARTITION_PRUNING))) { enabled = true; } if (!enabled) { return pctx; } Map<Rule, NodeProcessor> opRules = new LinkedHashMap<Rule, NodeProcessor>(); opRules.put(new RuleRegExp("R1", "(" + TableScanOperator.getOperatorName() + "%" + ".*" + ReduceSinkOperator.getOperatorName() + "%" + JoinOperator.getOperatorName() + "%)"), new JoinSynthetic()); // The dispatcher fires the processor corresponding to the closest matching // rule and passes the context along SyntheticContext context = new SyntheticContext(pctx); Dispatcher disp = new DefaultRuleDispatcher(null, opRules, context); GraphWalker ogw = new PreOrderOnceWalker(disp); // Create a list of top op nodes List<Node> topNodes = new ArrayList<Node>(); topNodes.addAll(pctx.getTopOps().values()); ogw.startWalking(topNodes, null); return pctx; }
@Override public ParseContext transform(ParseContext pctx) throws SemanticException { boolean enabled = false; String queryEngine = pctx.getConf().getVar(ConfVars.HIVE_EXECUTION_ENGINE); if (queryEngine.equals("tez") && pctx.getConf().getBoolVar(ConfVars.TEZ_DYNAMIC_PARTITION_PRUNING)) { enabled = true; } else if ((queryEngine.equals("spark") && pctx.getConf().isSparkDPPAny())) { enabled = true; } if (!enabled) { return pctx; } Map<Rule, NodeProcessor> opRules = new LinkedHashMap<Rule, NodeProcessor>(); opRules.put(new RuleRegExp("R1", "(" + TableScanOperator.getOperatorName() + "%" + ".*" + ReduceSinkOperator.getOperatorName() + "%" + JoinOperator.getOperatorName() + "%)"), new JoinSynthetic()); // The dispatcher fires the processor corresponding to the closest matching // rule and passes the context along SyntheticContext context = new SyntheticContext(pctx); Dispatcher disp = new DefaultRuleDispatcher(null, opRules, context); GraphWalker ogw = new PreOrderOnceWalker(disp); // Create a list of top op nodes List<Node> topNodes = new ArrayList<Node>(); topNodes.addAll(pctx.getTopOps().values()); ogw.startWalking(topNodes, null); return pctx; }
private List<ExprNodeDesc> createDerivatives(final Operator<?> currentOp, final ExprNodeDesc currentNode, final ExprNodeDesc sourceKey) throws SemanticException { List<ExprNodeDesc> resultExprs = new ArrayList<>(); return createDerivatives(resultExprs, currentOp, currentNode, sourceKey) ? resultExprs : new ArrayList<>(); }