@Test
  public void testFetchOperatorContext() throws Exception {
    HiveConf conf = new HiveConfForTest(getClass());
    conf.set("hive.support.concurrency", "false");
    conf.setVar(HiveConf.ConfVars.HIVE_MAPRED_MODE, "nonstrict");
    conf.setVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER,
        "org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory");
    SessionState.start(conf);
    String cmd = "create table fetchOp (id int, name string) " +
        "partitioned by (state string) " +
        "row format delimited fields terminated by '|' " +
        "stored as " +
        "inputformat 'org.apache.hadoop.hive.ql.exec.TestOperators$CustomInFmt' " +
        "outputformat 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' " +
        "tblproperties ('myprop1'='val1', 'myprop2' = 'val2')";
    Driver driver = new Driver(conf);
    CommandProcessorResponse response = driver.run(cmd);
    List<Object> result = new ArrayList<Object>();

    cmd = "load data local inpath '../data/files/employee.dat' " +
        "overwrite into table fetchOp partition (state='CA')";
    response = driver.run(cmd);

    cmd = "load data local inpath '../data/files/employee2.dat' " +
        "overwrite into table fetchOp partition (state='OR')";
    response = driver.run(cmd);

    cmd = "select * from fetchOp";
    driver.setMaxRows(500);
    response = driver.run(cmd);
    driver.getResults(result);
    assertEquals(20, result.size());
    driver.close();
  }
A custom input format that checks to make sure that the fetch operator
sets the required attributes.
ql/src/test/org/apache/hadoop/hive/ql/exec/TestOperators.java