| 57 | private static TupleFactory mTupleFactory = TupleFactory.getInstance(); |
| 58 | |
| 59 | @Override |
| 60 | public Long exec(Tuple input) throws IOException { |
| 61 | try { |
| 62 | DataBag bag = (DataBag)input.get(0); |
| 63 | return bag.size(); |
| 64 | } catch (ExecException ee) { |
| 65 | throw ee; |
| 66 | } catch (Exception e) { |
| 67 | int errCode = 2106; |
| 68 | String msg = "Error while computing count in " + this.getClass().getSimpleName(); |
| 69 | throw new ExecException(msg, errCode, PigException.BUG, e); |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | public String getInitial() { |
| 74 | return Initial.class.getName(); |