if (interQuery) {
context.setInterQuery();
StoreTableNode store = (StoreTableNode) plan;
this.partitionType = store.getPartitionType();
if (partitionType == PartitionType.RANGE_PARTITION) {
SortNode sortNode = (SortNode) store.getChild();
this.finalSchema = PlannerUtil.sortSpecsToSchema(sortNode.getSortKeys());
this.sortComp = new TupleComparator(finalSchema, sortNode.getSortKeys());
}
} else {
// The final result of a task will be written in a file named part-ss-nnnnnnn,
// where ss is the subquery id associated with this task, and nnnnnn is the task id.
Path outFilePath = StorageUtil.concatPath(queryContext.getStagingDir(), TajoConstants.RESULT_DIR_NAME,