Search in sources :

Example 31 with TezWork

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);
}
Also used : MapWork(org.apache.hadoop.hive.ql.plan.MapWork) BaseWork(org.apache.hadoop.hive.ql.plan.BaseWork) TezWork(org.apache.hadoop.hive.ql.plan.TezWork) Test(org.junit.Test)

Aggregations

TezWork (org.apache.hadoop.hive.ql.plan.TezWork)31 BaseWork (org.apache.hadoop.hive.ql.plan.BaseWork)16 MapWork (org.apache.hadoop.hive.ql.plan.MapWork)13 TezTask (org.apache.hadoop.hive.ql.exec.tez.TezTask)11 Task (org.apache.hadoop.hive.ql.exec.Task)9 ArrayList (java.util.ArrayList)8 SparkWork (org.apache.hadoop.hive.ql.plan.SparkWork)8 TableScanOperator (org.apache.hadoop.hive.ql.exec.TableScanOperator)7 HiveException (org.apache.hadoop.hive.ql.metadata.HiveException)7 MapredWork (org.apache.hadoop.hive.ql.plan.MapredWork)7 List (java.util.List)6 HiveConf (org.apache.hadoop.hive.conf.HiveConf)6 ConditionalTask (org.apache.hadoop.hive.ql.exec.ConditionalTask)6 Operator (org.apache.hadoop.hive.ql.exec.Operator)6 ReduceWork (org.apache.hadoop.hive.ql.plan.ReduceWork)6 Serializable (java.io.Serializable)5 LinkedList (java.util.LinkedList)5 Path (org.apache.hadoop.fs.Path)5 MoveWork (org.apache.hadoop.hive.ql.plan.MoveWork)5 IOException (java.io.IOException)4