use of org.apache.hadoop.hive.ql.plan.TezWork in project hive by apache.
the class TestGenTezWork method testCreateMap.
@Test
public void testCreateMap() throws SemanticException {
proc.process(rs, null, ctx, (Object[]) null);
assertNotNull(ctx.currentTask);
assertTrue(ctx.rootTasks.contains(ctx.currentTask));
TezWork work = ctx.currentTask.getWork();
assertEquals(work.getAllWork().size(), 1);
BaseWork w = work.getAllWork().get(0);
assertTrue(w instanceof MapWork);
MapWork mw = (MapWork) w;
// need to make sure names are set for tez to connect things right
assertNotNull(w.getName());
// map work should start with our ts op
assertSame(mw.getAliasToWork().entrySet().iterator().next().getValue(), ts);
// preceeding work must be set to the newly generated map
assertSame(ctx.preceedingWork, mw);
// should have a new root now
assertSame(ctx.currentRootOperator, fs);
}
Aggregations