示例#1
0
    protected void reduce(Text key, Iterable<DoubleWritable> values, Context context)
        throws IOException, InterruptedException {
      if (record == null) {
        throw new IOException("No output record found");
      }

      record.set(0, 125, true);
      record.set(1, true, true);
      record.set(2, 'c', true);
      record.set(3, Calendar.getInstance().getTime(), true);
      record.set(4, 234.526, true);
      record.set(5, Calendar.getInstance().getTime(), true);
      record.set(6, "foobar string", true);
      record.set(7, new byte[10], true);
      context.write(new Text("mrtarget"), record);
    }
示例#2
0
 public void map(LongWritable key, VerticaRecord value, Context context)
     throws IOException, InterruptedException {
   List<Object> record = value.getValues();
   context.write(new Text((String) record.get(1)), new DoubleWritable((Long) record.get(0)));
 }