/** * Change existing references in the context to point from child to parent operator. * @param cSEL child operator (to be removed, and merged into parent) * @param pSEL parent operator */ private void fixContextReferences(SelectOperator cSEL, SelectOperator pSEL) { Collection<Map<String, Operator<? extends OperatorDesc>>> mapsAliasToOpInfo = new ArrayList<Map<String, Operator<? extends OperatorDesc>>>(); for (JoinOperator joinOp : pctx.getJoinOps()) { if (joinOp.getConf().getAliasToOpInfo() != null) { mapsAliasToOpInfo.add(joinOp.getConf().getAliasToOpInfo()); } } for (MapJoinOperator mapJoinOp : pctx.getMapJoinOps()) { if (mapJoinOp.getConf().getAliasToOpInfo() != null) { mapsAliasToOpInfo.add(mapJoinOp.getConf().getAliasToOpInfo()); } } for (Map<String, Operator<? extends OperatorDesc>> aliasToOpInfo : mapsAliasToOpInfo) { for (Map.Entry<String, Operator<? extends OperatorDesc>> entry : aliasToOpInfo.entrySet()) { if (entry.getValue() == cSEL) { aliasToOpInfo.put(entry.getKey(), pSEL); } } } } }
/** * Change existing references in the context to point from child to parent operator. * @param cSEL child operator (to be removed, and merged into parent) * @param pSEL parent operator */ private void fixContextReferences(SelectOperator cSEL, SelectOperator pSEL) { Collection<Map<String, Operator<? extends OperatorDesc>>> mapsAliasToOpInfo = new ArrayList<Map<String, Operator<? extends OperatorDesc>>>(); for (JoinOperator joinOp : pctx.getJoinOps()) { if (joinOp.getConf().getAliasToOpInfo() != null) { mapsAliasToOpInfo.add(joinOp.getConf().getAliasToOpInfo()); } } for (MapJoinOperator mapJoinOp : pctx.getMapJoinOps()) { if (mapJoinOp.getConf().getAliasToOpInfo() != null) { mapsAliasToOpInfo.add(mapJoinOp.getConf().getAliasToOpInfo()); } } for (Map<String, Operator<? extends OperatorDesc>> aliasToOpInfo : mapsAliasToOpInfo) { for (Map.Entry<String, Operator<? extends OperatorDesc>> entry : aliasToOpInfo.entrySet()) { if (entry.getValue() == cSEL) { aliasToOpInfo.put(entry.getKey(), pSEL); } } } } }
pGraphContext.getMapJoinOps().remove(mapJoinOp);
BucketJoinProcCtx context) throws SemanticException { if (!this.pGraphContext.getMapJoinOps().contains(mapJoinOp)) { return false;
pGraphContext.getMapJoinOps().remove(mapJoinOp);
BucketJoinProcCtx context) throws SemanticException { if (!this.pGraphContext.getMapJoinOps().contains(mapJoinOp)) { return false;
Set<MapJoinOperator> mapJoinMap = pactx.getMapJoinOps(); if (mapJoinMap == null) { mapJoinMap = new HashSet<MapJoinOperator>();
Set<MapJoinOperator> mapJoinMap = pactx.getMapJoinOps(); if (mapJoinMap == null) { mapJoinMap = new HashSet<MapJoinOperator>();
protected MapJoinOperator convertJoinToBucketMapJoin( JoinOperator joinOp, SortBucketJoinProcCtx joinContext) throws SemanticException { MapJoinOperator mapJoinOp = new MapJoinProcessor().convertMapJoin( pGraphContext.getConf(), joinOp, joinOp.getConf().isLeftInputJoin(), joinOp.getConf().getBaseSrc(), joinOp.getConf().getMapAliases(), joinContext.getBigTablePosition(), false, false); if (mapJoinOp == null) { return null; } // Remove the join operator from the query join context // Data structures coming from QBJoinTree mapJoinOp.getConf().setQBJoinTreeProps(joinOp.getConf()); // pGraphContext.getMapJoinOps().add(mapJoinOp); pGraphContext.getJoinOps().remove(joinOp); convertMapJoinToBucketMapJoin(mapJoinOp, joinContext); return mapJoinOp; }
protected MapJoinOperator convertJoinToBucketMapJoin( JoinOperator joinOp, SortBucketJoinProcCtx joinContext) throws SemanticException { MapJoinOperator mapJoinOp = new MapJoinProcessor().convertMapJoin( pGraphContext.getConf(), joinOp, joinOp.getConf().isLeftInputJoin(), joinOp.getConf().getBaseSrc(), joinOp.getConf().getMapAliases(), joinContext.getBigTablePosition(), false, false); // Remove the join operator from the query join context // Data structures coming from QBJoinTree mapJoinOp.getConf().setQBJoinTreeProps(joinOp.getConf()); // pGraphContext.getMapJoinOps().add(mapJoinOp); pGraphContext.getJoinOps().remove(joinOp); convertMapJoinToBucketMapJoin(mapJoinOp, joinContext); return mapJoinOp; }
if (parseCtx.getMapJoinOps().contains(reducerOp)) { id = ((MapJoinOperator)reducerOp).getConf().getId();
if (parseContext.getMapJoinOps().contains(childReducer)) { id = ((MapJoinOperator)childReducer).getConf().getId();
if (parseCtx.getMapJoinOps().contains(reducerOp)) { id = ((MapJoinOperator)reducerOp).getConf().getId();
if (parseContext.getMapJoinOps().contains(childReducer)) { id = ((MapJoinOperator)childReducer).getConf().getId();
if (!this.pGraphContext.getMapJoinOps().contains(mapJoinOp)) { return false;
if (!this.pGraphContext.getMapJoinOps().contains(mapJoinOp)) { return false;
/** * Create a clone of the parse context */ public ParseContext getParseContext(ParseContext pCtx, List<Task<? extends Serializable>> rootTasks) { ParseContext clone = new ParseContext(queryState, pCtx.getOpToPartPruner(), pCtx.getOpToPartList(), pCtx.getTopOps(), pCtx.getJoinOps(), pCtx.getSmbMapJoinOps(), pCtx.getLoadTableWork(), pCtx.getLoadFileWork(), pCtx.getColumnStatsAutoGatherContexts(), pCtx.getContext(), pCtx.getIdToTableNameMap(), pCtx.getDestTableId(), pCtx.getUCtx(), pCtx.getListMapJoinOpsNoReducer(), pCtx.getPrunedPartitions(), pCtx.getTabNameToTabObject(), pCtx.getOpToSamplePruner(), pCtx.getGlobalLimitCtx(), pCtx.getNameToSplitSample(), pCtx.getSemanticInputs(), rootTasks, pCtx.getOpToPartToSkewedPruner(), pCtx.getViewAliasToInput(), pCtx.getReduceSinkOperatorsAddedByEnforceBucketingSorting(), pCtx.getAnalyzeRewrite(), pCtx.getCreateTable(), pCtx.getCreateViewDesc(), pCtx.getQueryProperties(), pCtx.getViewProjectToTableSchema(), pCtx.getAcidSinks()); clone.setFetchTask(pCtx.getFetchTask()); clone.setLineageInfo(pCtx.getLineageInfo()); clone.setMapJoinOps(pCtx.getMapJoinOps()); clone.setRsToRuntimeValuesInfoMap(pCtx.getRsToRuntimeValuesInfoMap()); clone.setRsOpToTsOpMap(pCtx.getRsOpToTsOpMap()); return clone; }
/** * Create a clone of the parse context */ public ParseContext getParseContext(ParseContext pCtx, List<Task<? extends Serializable>> rootTasks) { ParseContext clone = new ParseContext(queryState, pCtx.getOpToPartPruner(), pCtx.getOpToPartList(), pCtx.getTopOps(), pCtx.getJoinOps(), pCtx.getSmbMapJoinOps(), pCtx.getLoadTableWork(), pCtx.getLoadFileWork(), pCtx.getColumnStatsAutoGatherContexts(), pCtx.getContext(), pCtx.getIdToTableNameMap(), pCtx.getDestTableId(), pCtx.getUCtx(), pCtx.getListMapJoinOpsNoReducer(), pCtx.getPrunedPartitions(), pCtx.getTabNameToTabObject(), pCtx.getOpToSamplePruner(), pCtx.getGlobalLimitCtx(), pCtx.getNameToSplitSample(), pCtx.getSemanticInputs(), rootTasks, pCtx.getOpToPartToSkewedPruner(), pCtx.getViewAliasToInput(), pCtx.getReduceSinkOperatorsAddedByEnforceBucketingSorting(), pCtx.getAnalyzeRewrite(), pCtx.getCreateTable(), pCtx.getCreateViewDesc(), pCtx.getMaterializedViewUpdateDesc(), pCtx.getQueryProperties(), pCtx.getViewProjectToTableSchema(), pCtx.getAcidSinks()); clone.setFetchTask(pCtx.getFetchTask()); clone.setLineageInfo(pCtx.getLineageInfo()); clone.setMapJoinOps(pCtx.getMapJoinOps()); clone.setRsToRuntimeValuesInfoMap(pCtx.getRsToRuntimeValuesInfoMap()); clone.setRsToSemiJoinBranchInfo(pCtx.getRsToSemiJoinBranchInfo()); clone.setColExprToGBMap(pCtx.getColExprToGBMap()); clone.setSemiJoinHints(pCtx.getSemiJoinHints()); return clone; }
protected MapJoinOperator convertJoinToBucketMapJoin( JoinOperator joinOp, SortBucketJoinProcCtx joinContext) throws SemanticException { MapJoinOperator mapJoinOp = new MapJoinProcessor().convertMapJoin( pGraphContext.getConf(), joinOp, joinOp.getConf().isLeftInputJoin(), joinOp.getConf().getBaseSrc(), joinOp.getConf().getMapAliases(), joinContext.getBigTablePosition(), false, false); // Remove the join operator from the query join context // Data structures coming from QBJoinTree mapJoinOp.getConf().setQBJoinTreeProps(joinOp.getConf()); // pGraphContext.getMapJoinOps().add(mapJoinOp); pGraphContext.getJoinOps().remove(joinOp); convertMapJoinToBucketMapJoin(mapJoinOp, joinContext); return mapJoinOp; }
/** * Create a clone of the parse context */ public ParseContext getParseContext(ParseContext pCtx, List<Task<? extends Serializable>> rootTasks) { ParseContext clone = new ParseContext(conf, pCtx.getOpToPartPruner(), pCtx.getOpToPartList(), pCtx.getTopOps(), pCtx.getJoinOps(), pCtx.getSmbMapJoinOps(), pCtx.getLoadTableWork(), pCtx.getLoadFileWork(), pCtx.getContext(), pCtx.getIdToTableNameMap(), pCtx.getDestTableId(), pCtx.getUCtx(), pCtx.getListMapJoinOpsNoReducer(), pCtx.getPrunedPartitions(), pCtx.getOpToSamplePruner(), pCtx.getGlobalLimitCtx(), pCtx.getNameToSplitSample(), pCtx.getSemanticInputs(), rootTasks, pCtx.getOpToPartToSkewedPruner(), pCtx.getViewAliasToInput(), pCtx.getReduceSinkOperatorsAddedByEnforceBucketingSorting(), pCtx.getAnalyzeRewrite(), pCtx.getCreateTable(), pCtx.getQueryProperties()); clone.setFetchTask(pCtx.getFetchTask()); clone.setLineageInfo(pCtx.getLineageInfo()); clone.setMapJoinOps(pCtx.getMapJoinOps()); return clone; } }