/** * java level API * * @param input expects a tuple containing two numeric DataAtom value * @param output returns a single numeric DataAtom value, which is first floating-point argument * with the sign of the second floating-point argument. */ @Override public Float exec(Tuple input) throws IOException { if (input == null || input.size() < 2) return null; try { float first = (Float) input.get(0); float second = (Float) input.get(1); return Math.copySign(first, second); } catch (Exception e) { throw WrappedIOException.wrap("Caught exception processing input row ", e); } }
public String exec(Tuple input) throws IOException { if (input == null || input.size() == 0) return null; try { String str = (String) input.get(0); return str.toUpperCase(); } catch (Exception e) { throw WrappedIOException.wrap("Caught exception processing input row ", e); } }