@Override public void plan(SchemaContext pc, ExecutionSequence es, BehaviorConfiguration config) throws PEException { Database<?> ondb = null; for (TableKey tk : tables) { if (ondb == null) ondb = tk.getTable().getDatabase(pc); else if (!ondb.equals(tk.getTable().getDatabase(pc))) throw new SchemaException(Pass.PLANNER, "Unable to show table status across databases"); } String origCommand = buildInitialShowStatusCommand(); if (onGroup.isSingleSiteGroup()) { es.append(ProjectingExecutionStep.build(pc, ondb, onGroup, origCommand)); } else { // System.out.println(origCommand); TempGroupManager tgm = new TempGroupManager(); TempTable t1 = buildFirstTempTable(pc, tgm.getGroup(true)); if (!pc.hasCurrentDatabase() && !t1.hasDatabase(pc)) { // if no current database is set and the temp table has no database // we need to set one t1.setDatabase(pc, (PEDatabase) ondb, false); } SelectStatement firstSelect = buildFirstSelect(pc, t1); DistributionKeyTemplate dkt = buildKeyTemplate(); for (int i = 0; i < firstSelect.getProjectionEdge().size(); i++) dkt.addColumn(firstSelect.getProjectionEdge().get(i), i); DistributionVector sourceVect = buildVector(pc); tgm.plan(pc); es.append( RedistributionExecutionStep.build( pc, ondb, onGroup, origCommand, sourceVect, t1, t1.getStorageGroup(pc), dkt, null)); SelectStatement aggCommand = buildAggCommand(firstSelect); // System.out.println(aggCommand.getSQL()); es.append( ProjectingExecutionStep.build( pc, ondb, t1.getStorageGroup(pc), null, null, aggCommand, null)); } }