boolean replicatedTableDML = isReplicatedTableDML == 1;
SynthesizedPlanFragment[] pfs = null;
VoltTable[] results = null;
ParameterSet params = null;
if (executor.getBackendTarget() == BackendTarget.HSQLDB_BACKEND) {
pfs = new SynthesizedPlanFragment[1];
// JUST SEND ONE FRAGMENT TO HSQL, IT'LL IGNORE EVERYTHING BUT SQL AND DEPID
pfs[0] = new SynthesizedPlanFragment();
pfs[0].fragmentId = SysProcFragmentId.PF_runAdHocFragment;
pfs[0].outputDependencyIds = new int[]{ AGG_DEPID };
pfs[0].multipartition = false;
params = new ParameterSet();
params.setParameters(AGG_DEPID, "", sql);
pfs[0].parameters = params;
}
else {
pfs = new SynthesizedPlanFragment[2];
if (collectorFragment != null) {
pfs = new SynthesizedPlanFragment[2];
// COLLECTION FRAGMENT NEEDS TO RUN FIRST
pfs[1] = new SynthesizedPlanFragment();
pfs[1].fragmentId = SysProcFragmentId.PF_runAdHocFragment;
pfs[1].outputDependencyIds = new int[]{ COLLECT_DEPID };
pfs[1].multipartition = true;
params = new ParameterSet();
params.setParameters(COLLECT_DEPID, collectorFragment, sql);
pfs[1].parameters = params;
}
else {
pfs = new SynthesizedPlanFragment[1];
}
// AGGREGATION FRAGMENT DEPENDS ON THE COLLECTION FRAGMENT
pfs[0] = new SynthesizedPlanFragment();
pfs[0].fragmentId = SysProcFragmentId.PF_runAdHocFragment;
pfs[0].outputDependencyIds = new int[]{ AGG_DEPID };
if (collectorFragment != null)
pfs[0].inputDependencyIds = new int[] { COLLECT_DEPID };
pfs[0].multipartition = false;
params = new ParameterSet();
params.setParameters(AGG_DEPID, aggregatorFragment, sql);
pfs[0].parameters = params;
}
// distribute and execute these fragments providing pfs and id of the
// aggregator's output dependency table.