kite-sdk/kite — pull request #168 by rdblue (2014-08-07 00:13:45+00:00)
Title: CDK-549: Add DoFn transforms to copy and import commands

This adds two options to the copy and import commands:
* `--jar` adds a jar that contains user code
* `--transform` specifies a java DoFn class that will be used to transform records in a mapper.

CopyTask now inherits from a TransformTask that requires a DoFn. TransformTask is basically CopyTask edited to use two different type parameters and a transform from the source to the target types.

I tested this with the MovieLens ratings dataset on the CDH 4.4 VM and this transform:
```java
package com.cloudera;

import org.apache.avro.generic.GenericRecord;
import org.apache.crunch.MapFn;

public class ImportRatings extends MapFn {
@Override
public GenericRecord map(GenericRecord input) {
Long ts = (Long) input.get("timestamp");
ts *= 1000; // convert seconds to milliseconds
input.put("timestamp", ts);
return input;
}
}
```