@Test(expected=IllegalArgumentException.class) public void testExecOnNull() throws Exception { idReplacer.exec(null); }
@Override public Tuple exec(Tuple input) throws IOException { checkArguments(input); String oldIdPath = (String) input.get(0); String newId = (String) input.get(1); Tuple record = getRecord(input); Schema recordSchema = getRecordSchema(getInputSchema()); replaceIdFieldInTuple(newId, oldIdPath, record, recordSchema); return record; }
IdReplacerUDF extends EvalFunc<Tuple> { @Override public Tuple exec(Tuple input) throws IOException { checkArguments(input); String oldIdPath = (String) input.get(0); String newId = (String) input.get(1); Tuple record = getRecord(input); Schema recordSchema = getRecordSchema(getInputSchema()); replaceIdFieldInTuple(newId, oldIdPath, record, recordSchema); return record; } }
IdReplacerUDF extends EvalFunc<Tuple> { @Override public Tuple exec(Tuple input) throws IOException { checkArguments(input); String oldIdPath = (String) input.get(0); String newId = (String) input.get(1); Tuple record = getRecord(input); Schema recordSchema = getRecordSchema(getInputSchema()); replaceIdFieldInTuple(newId, oldIdPath, record, recordSchema); return record; }  }
IdReplacerUDF extends EvalFunc<Tuple> { @Override public Tuple exec(Tuple input) throws IOException { checkArguments(input); String oldIdPath = (String) input.get(0); String newId = (String) input.get(1); Tuple record = getRecord(input); Schema recordSchema = getRecordSchema(getInputSchema()); replaceIdFieldInTuple(newId, oldIdPath, record, recordSchema); return record; }  @Override /** * UDF replaces original id with new id string. The input tuple should contain following elements: * a dot-separated list of field ids representing a path in the input tree structure (first element), * new id string (second element), the rest of the tuple should contain the consecutive fields of the input record. * * Replacing of multiple id fields is not implemented yet. Only one field replacing is implemented. * * @param tuple a tuple (id path - dot-separated list of fields indicating position in the record schema tree, new id string, input tuple fields...) * @return * @throws IOException */ Tuple exec(Tuple input); @Override Schema outputSchema(Schema input); }
IdReplacerUDF extends EvalFunc<Tuple> { @Override public Tuple exec(Tuple input) throws IOException { checkArguments(input); String oldIdPath = (String) input.get(0); String newId = (String) input.get(1); Tuple record = getRecord(input); Schema recordSchema = getRecordSchema(getInputSchema()); replaceIdFieldInTuple(newId, oldIdPath, record, recordSchema); return record; }  @Override /** * UDF replaces original id with new id string. The input tuple should contain following elements: * a dot-separated list of field ids representing a path in the input tree structure (first element), * new id string (second element), the rest of the tuple should contain the consecutive fields of the input record. * * Replacing of multiple id fields is not implemented yet. Only one field replacing is implemented. * * @param tuple a tuple (id path - dot-separated list of fields indicating position in the record schema tree, new id string, input tuple fields...) * @return * @throws IOException */ Tuple exec(Tuple input); @Override Schema outputSchema(Schema input);  }