// split
LOSplit split1 = new LOSplit(plan);
// output1
LOSplitOutput splitOutput1 = new LOSplitOutput(plan);
// output2
LOSplitOutput splitOutput2 = new LOSplitOutput(plan);
// Create expression inner plan #1
LogicalExpressionPlan innerPlan1 = new LogicalExpressionPlan();
ProjectExpression project11 = new ProjectExpression(innerPlan1, 0, 0, splitOutput1);
ProjectExpression project12 = new ProjectExpression(innerPlan1, 0, 1, splitOutput1);
NotEqualExpression notequal1 = new NotEqualExpression(innerPlan1, project11, project12);
// Create expression inner plan #2
LogicalExpressionPlan innerPlan2 = new LogicalExpressionPlan();
ProjectExpression project21 = new ProjectExpression(innerPlan2, 0, 0, splitOutput2);
ConstantExpression const21 = new ConstantExpression(innerPlan2, 26L);
LessThanEqualExpression lesser21 = new LessThanEqualExpression(innerPlan2, project21, const21);
splitOutput1.setFilterPlan(innerPlan1);
splitOutput2.setFilterPlan(innerPlan2);
plan.add(load1);
plan.add(split1);
plan.add(splitOutput1);
plan.add(splitOutput2);
plan.connect(load1, split1);
plan.connect(split1, splitOutput1);
plan.connect(split1, splitOutput2);
CompilationMessageCollector collector = new CompilationMessageCollector();
TypeCheckingRelVisitor typeChecker = new TypeCheckingRelVisitor(plan, collector);
typeChecker.visit();
printMessageCollector(collector);
//printTypeGraph(plan);
if (collector.hasError()) {
throw new AssertionError("Expect no error");
}
// check split itself
{
LogicalSchema endResultSchema1 = split1.getSchema();
// outer
assertEquals(DataType.BYTEARRAY, endResultSchema1.getField(0).type);
assertEquals(DataType.INTEGER, endResultSchema1.getField(1).type);
}
// check split output #1
{
LogicalSchema endResultSchema1 = splitOutput1.getSchema();
// outer
assertEquals(DataType.BYTEARRAY, endResultSchema1.getField(0).type);
assertEquals(DataType.INTEGER, endResultSchema1.getField(1).type);
}
// check split output #2
{
LogicalSchema endResultSchema2 = splitOutput2.getSchema();
// outer
assertEquals(DataType.BYTEARRAY, endResultSchema2.getField(0).type);
assertEquals(DataType.INTEGER, endResultSchema2.getField(1).type);
}