| 42 | public class SIZE extends EvalFunc<Long> { |
| 43 | |
| 44 | @Override |
| 45 | public Long exec(Tuple input) throws IOException { |
| 46 | try { |
| 47 | DataByteArray dba = (DataByteArray)(input.get(0)); |
| 48 | return dba == null ? null : Long.valueOf(dba.size()); |
| 49 | } catch (ExecException exp) { |
| 50 | throw exp; |
| 51 | } catch (Exception e) { |
| 52 | int errCode = 2106; |
| 53 | String msg = "Error while computing size in " + this.getClass().getSimpleName(); |
| 54 | throw new ExecException(msg, errCode, PigException.BUG, e); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | @Override |
| 59 | public Schema outputSchema(Schema input) { |