/**
* It checks if an output schema of a projectable node and target's output data types are equivalent to each other.
*/
private static void verifyProjectableOutputSchema(Projectable node) throws PlanningException {
Schema outputSchema = node.getOutSchema();
Schema targetSchema = PlannerUtil.targetToSchema(node.getTargets());
if (outputSchema.size() != node.getTargets().length) {
throw new PlanningException(String.format("Output schema and Target's schema are mismatched at Node (%d)",
+ node.getPID()));
}
for (int i = 0; i < outputSchema.size(); i++) {
if (!outputSchema.getColumn(i).getDataType().equals(targetSchema.getColumn(i).getDataType())) {
Column targetColumn = targetSchema.getColumn(i);
Column insertColumn = outputSchema.getColumn(i);
throw new PlanningException("ERROR: " +
insertColumn.getSimpleName() + " is of type " + insertColumn.getDataType().getType().name() +
", but target column '" + targetColumn.getSimpleName() + "' is of type " +
targetColumn.getDataType().getType().name());