// func, and I don't want to mess with that here.
@Test
public void testJoinDifferentJoinTypes() throws FrontendException {
LogicalPlan lp = new LogicalPlan();
LogicalSchema jaschema1 = new LogicalSchema();
jaschema1.addField(new LogicalSchema.LogicalFieldSchema(
"x", null, DataType.INTEGER));
LOLoad A1 = new LOLoad(new FileSpec("/abc",
new FuncSpec("/fooload", new String[] {"x", "y"})), jaschema1, lp, null);
lp.add(A1);
// B = load
LogicalSchema jbschema1 = new LogicalSchema();
jbschema1.addField(new LogicalSchema.LogicalFieldSchema(
"y", null, DataType.INTEGER));
LOLoad B1 = new LOLoad(new FileSpec("/def",
new FuncSpec("PigStorage", "\t")), jbschema1, lp, null);
lp.add(B1);
// C = join
LogicalSchema jcschema1 = new LogicalSchema();
jcschema1.addField(new LogicalSchema.LogicalFieldSchema(
"x", null, DataType.INTEGER));
jcschema1.addField(new LogicalSchema.LogicalFieldSchema(
"y", null, DataType.INTEGER));
LogicalExpressionPlan aprojplan1 = new LogicalExpressionPlan();
new ProjectExpression(aprojplan1, 0, 0, null);
LogicalExpressionPlan bprojplan1 = new LogicalExpressionPlan();
new ProjectExpression(bprojplan1, 1, 0, null);
MultiMap<Integer, LogicalExpressionPlan> mm1 =
new MultiMap<Integer, LogicalExpressionPlan>();
mm1.put(0, aprojplan1);
mm1.put(1, bprojplan1);
LOJoin C1 = new LOJoin(lp, mm1, JOINTYPE.HASH, new boolean[] {true, true});
C1.neverUseForRealSetSchema(jcschema1);
lp.add(C1);
lp.connect(A1, C1);
lp.connect(B1, C1);
// A = load
LogicalSchema jaschema2 = new LogicalSchema();
jaschema2.addField(new LogicalSchema.LogicalFieldSchema(
"x", null, DataType.INTEGER));
LOLoad A2 = new LOLoad(new FileSpec("/abc",
new FuncSpec("/fooload", new String[] {"x", "y"})), jaschema2, lp, null);
lp.add(A2);
// B = load
LogicalSchema jbschema2 = new LogicalSchema();
jbschema2.addField(new LogicalSchema.LogicalFieldSchema(
"y", null, DataType.INTEGER));
LOLoad B2 = new LOLoad(new FileSpec("/def",
new FuncSpec("PigStorage", "\t")), jbschema2, lp, null);
lp.add(B2);
// C = join
LogicalSchema jcschema2 = new LogicalSchema();
jcschema2.addField(new LogicalSchema.LogicalFieldSchema(
"x", null, DataType.INTEGER));
jcschema2.addField(new LogicalSchema.LogicalFieldSchema(
"y", null, DataType.INTEGER));
LogicalExpressionPlan aprojplan2 = new LogicalExpressionPlan();
new ProjectExpression(aprojplan2, 0, 0, null);
LogicalExpressionPlan bprojplan2 = new LogicalExpressionPlan();
new ProjectExpression(bprojplan2, 1, 0, null);