schema.addField(new LogicalSchema.LogicalFieldSchema("name", null, DataType.CHARARRAY));
schema.addField(new LogicalSchema.LogicalFieldSchema("age", null, DataType.INTEGER));
schema.getField(0).uid = 1;
schema.getField(1).uid = 2;
schema.getField(2).uid = 3;
LogicalRelationalOperator l1 = new LOLoad(schema, plan);
l1.setAlias("A");
plan.add(l1);
schema = new LogicalSchema();
schema.addField(new LogicalSchema.LogicalFieldSchema("id", null, DataType.INTEGER));
schema.addField(new LogicalSchema.LogicalFieldSchema("dept", null, DataType.INTEGER));
schema.addField(new LogicalSchema.LogicalFieldSchema("salary", null, DataType.FLOAT));
schema.getField(0).uid = 4;
schema.getField(1).uid = 5;
schema.getField(2).uid = 6;
LogicalRelationalOperator l2 = new LOLoad(schema, plan);
l2.setAlias("B");
plan.add(l2);
MultiMap<Integer, LogicalExpressionPlan> joinPlans = new MultiMap<Integer, LogicalExpressionPlan>();
LogicalRelationalOperator j1 = new LOJoin(plan, joinPlans, LOJoin.JOINTYPE.HASH, new boolean[]{true, true});
LogicalExpressionPlan p1 = new LogicalExpressionPlan();
ProjectExpression lp1 = new ProjectExpression(p1, 0, 1, j1);
p1.add(lp1);
joinPlans.put(0, p1);
LogicalExpressionPlan p2 = new LogicalExpressionPlan();
ProjectExpression lp2 = new ProjectExpression(p2, 1, 1, j1);
p2.add(lp2);
joinPlans.put(1, p2);
j1.setAlias("C");
plan.add(j1);
// build an expression with no AND
LogicalExpressionPlan p3 = new LogicalExpressionPlan();
LogicalRelationalOperator f1 = new LOFilter(plan, p3);
LogicalExpression lp3 = new ProjectExpression(p3, 0, 2, f1);
LogicalExpression cont = new ConstantExpression(p3, new Integer(3));
p3.add(lp3);
p3.add(cont);
LogicalExpression eq = new EqualExpression(p3, lp3, cont);
f1.setAlias("D");
plan.add(f1);
LogicalRelationalOperator s1 = new LOStore(plan, null, null, null);
plan.add(s1);
// load --|-join - filter - store
// load --|
plan.connect(l1, j1);