Skip to content

Commit

Permalink
added a bit more documentation for a couple udfs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Perkins committed Aug 22, 2011
1 parent 2082a06 commit 0fd2f6b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 547 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/infochimps/hadoop/pig/geo/AttachGUID.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
Given a qualifier (namespace + '.' + protocol + '.' + layer), a domain id field name (eg. 'geoname_id')
and a geoJSON entity, generates a guid for it. To do this the method parses the geoJSON, pulls out
and a geoJSON entity, generates an md5id for it. To do this the method parses the geoJSON, pulls out
the value of the named id field from the properties HashMap and concatenates the qualifier and the
domain id. If there is no domain id use a '-1'.
Expand All @@ -47,7 +47,7 @@ public String exec(Tuple input) throws IOException {
return null;

String qualifier = input.get(0).toString();
String id_field = input.get(1).toString(); // if this is -1, then the records are assumed to have no domain id. The full json of the object itself is used.
String id_field = input.get(1).toString(); // if this is -1 the json shouldn't contain it as a key
String json = input.get(2).toString();
String resultId = null;
String result = null;
Expand All @@ -59,7 +59,7 @@ public String exec(Tuple input) throws IOException {
String domainId = feature.getProperties().getString(id_field);
resultId = constructGUID(qualifier, domainId);
} else {
resultId = constructGUID(qualifier, json);
resultId = constructGUID(qualifier, json); // use the full json string itself
}
resultFeature = new GeoFeature(resultId, feature.getMfGeometry(), feature.getProperties());
result = resultFeature.serialize();
Expand Down
Loading

0 comments on commit 0fd2f6b

Please sign in to comment.