Skip to content
This repository has been archived by the owner on Feb 21, 2019. It is now read-only.

Commit

Permalink
Simplified coalesce a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
xstevens committed Sep 13, 2012
1 parent 11f1b78 commit ee25f8d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/com/mozilla/pig/eval/Coalesce.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,15 @@ public Object exec(Tuple input) throws IOException {
return null;
}

Object ret = null;
Object o = null;
for (int i=0; i < input.size(); i++) {
Object o = input.get(i);
o = input.get(i);
if (o != null) {
ret = o;
break;
}
}

return ret;
return o;
}

public Schema outputSchema(Schema input) {
Expand Down

0 comments on commit ee25f8d

Please sign in to comment.