}
}
if (node instanceof ScanNode || node instanceof JoinNode) {
Schema baseSchema = null;
if (node instanceof ScanNode) {
baseSchema = ((ScanNode)node).getTableSchema();
} else if (node instanceof JoinNode) {
baseSchema = node.getInSchema(); // composite schema
}
if (newEvaluatedTargetIds.size() > 0) {
// fill addedTargets with output columns and new expression columns (e.g., aliased column or expressions)
Target[] addedTargets = new Target[baseSchema.getColumnNum() + newEvaluatedTargetIds.size()];
PlannerUtil.schemaToTargets(baseSchema, addedTargets);
int baseIdx = baseSchema.getColumnNum();
for (int i = 0; i < newEvaluatedTargetIds.size(); i++) {
addedTargets[baseIdx + i] = getTarget(newEvaluatedTargetIds.get(i));
}
// set targets to ScanNode because it needs to evaluate expressions