@Override
    protected void map(WritableComparable key, HCatRecord value,
               org.apache.hadoop.mapreduce.Mapper<WritableComparable, HCatRecord,
                 WritableComparable, HCatRecord>.Context context)
      throws IOException, InterruptedException {
      boolean isnoPartPig = context.getConfiguration().getBoolean(IS_PIG_NON_PART_TABLE, false);
      intnum1000 = ((Integer) value.get(0));
      id = ((Short) value.get(1));
      intnum5 = (((Byte) value.get(2)));
      intnum100 = (((Integer) value.get(3)));
      intnum = ((Integer) value.get(4));
      longnum = ((Long) value.get(5));
      floatnum = ((Float) value.get(6));
      doublenum = ((Double) value.get(7));
      HCatRecord output = new DefaultHCatRecord(8);
      output.set(0, intnum1000 + 10);
      if (isnoPartPig) {
        output.set(1, ((int) (id + 10)));
      } else {
        output.set(1, ((short) (id + 10)));
      }
      if (isnoPartPig) {
        output.set(2, (int) (intnum5 + 10));
      } else {
        output.set(2, (byte) (intnum5 + 10));
      }

      output.set(3, intnum100 + 10);
      output.set(4, intnum + 10);
      output.set(5, (long) (longnum + 10));
      output.set(6, (float) (floatnum + 10));
      output.set(7, (double) (doublenum + 10));
      for (int i = 0; i < 8; i++) {
        System.err.println("XXX: class:" + output.get(i).getClass());
      }
      context.write(new IntWritable(0), output);

    }
This is a map reduce test for testing hcat which goes against the "numbers"
table and writes data to another table. It reads data from numbers which
is an unpartitioned table and adds 10 to each field. It stores the result into
the datestamp='20100101' partition of the numbers_part_empty_initially table if the second
command line arg is "part". If the second cmdline arg is "nopart" then the
result is stored into the 'numbers_nopart_empty_initially' (unpartitioned) table.
If the second cmdline arg is "nopart_pig", then the result is stored into the
'numbers_nopart_pig_empty_initially' (unpartitioned) table with the tinyint
and smallint columns in "numbers" being stored as "int" (since pig cannot handle
tinyint and smallint)

Usage: hadoop jar storenumbers <serveruri> <part|nopart|nopart_pig> <-libjars hive-hcat jar>
 If the second argument is "part" data is written to datestamp = '2010101' partition of the numbers_part_empty_initially table.
 If the second argument is "nopart", data is written to the unpartitioned numbers_nopart_empty_initially table.
 If the second argument is "nopart_pig", data is written to the unpartitioned numbers_nopart_pig_empty_initially table.
 The hcat jar location should be specified as file://<full path to jar>
hcatalog/src/test/e2e/hcatalog/udfs/java/org/apache/hive/hcatalog/utils/StoreNumbers.java