@Test public void testZeroWithMFAKey2() throws IOException { Tuple input = tupleFactory.newTuple(1); input.set(0, "zero=420-01"); Zero zero = new Zero(); Tuple carrier = zero.exec(input); assertEquals("stc/al-jawal-saudi-arabia", carrier.get(0)); assertEquals("SA", carrier.get(1)); }
@Override public final Tuple exec(final Tuple input) throws IOException { if (input == null || input.get(0) == null) { return null; } String mcc = extractXcsValue((String) input.get(0)); if (mcc == null) { return null; } MccMnc carrier = (MccMnc) this.mccMncMap.get(mcc); Tuple output = tupleFactory.newTuple(2); if (carrier != null) { output.set(0, carrier.getName()); output.set(1, carrier.getISO()); } else { warn("Key was not found in MccMnc Map: " + mcc, PigWarning.UDF_WARNING_1); output.set(0, mcc); output.set(1, null); } return output; }
Zero extends EvalFunc<Tuple> { @Override public final Tuple exec(final Tuple input) throws IOException { if (input == null || input.get(0) == null) { return null; } String mcc = extractXcsValue((String) input.get(0)); if (mcc == null) { return null; } MccMnc carrier = (MccMnc) this.mccMncMap.get(mcc); Tuple output = tupleFactory.newTuple(2); if (carrier != null) { output.set(0, carrier.getName()); output.set(1, carrier.getISO()); } else { warn("Key was not found in MccMnc Map: " + mcc, PigWarning.UDF_WARNING_1); output.set(0, mcc); output.set(1, null); } return output; } }
Zero extends EvalFunc<Tuple> { @Override public final Tuple exec(final Tuple input) throws IOException { if (input == null || input.get(0) == null) { return null; } String mcc = extractXcsValue((String) input.get(0)); if (mcc == null) { return null; } MccMnc carrier = (MccMnc) this.mccMncMap.get(mcc); Tuple output = tupleFactory.newTuple(2); if (carrier != null) { output.set(0, carrier.getName()); output.set(1, carrier.getISO()); } else { warn("Key was not found in MccMnc Map: " + mcc, PigWarning.UDF_WARNING_1); output.set(0, mcc); output.set(1, null); } return output; } Zero(); }
Zero extends EvalFunc<Tuple> { @Override public final Tuple exec(final Tuple input) throws IOException { if (input == null || input.get(0) == null) { return null; } String mcc = extractXcsValue((String) input.get(0)); if (mcc == null) { return null; } MccMnc carrier = (MccMnc) this.mccMncMap.get(mcc); Tuple output = tupleFactory.newTuple(2); if (carrier != null) { output.set(0, carrier.getName()); output.set(1, carrier.getISO()); } else { warn("Key was not found in MccMnc Map: " + mcc, PigWarning.UDF_WARNING_1); output.set(0, mcc); output.set(1, null); } return output; } Zero(); @Override final Tuple exec(final Tuple input); final org.apache.pig.impl.logicalLayer.schema.Schema outputSchema(final org.apache.pig.impl.logicalLayer.schema.Schema input); }
Zero extends EvalFunc<Tuple> { @Override public final Tuple exec(final Tuple input) throws IOException { if (input == null || input.get(0) == null) { return null; } String mcc = extractXcsValue((String) input.get(0)); if (mcc == null) { return null; } MccMnc carrier = (MccMnc) this.mccMncMap.get(mcc); Tuple output = tupleFactory.newTuple(2); if (carrier != null) { output.set(0, carrier.getName()); output.set(1, carrier.getISO()); } else { warn("Key was not found in MccMnc Map: " + mcc, PigWarning.UDF_WARNING_1); output.set(0, mcc); output.set(1, null); } return output; } Zero(); @Override final Tuple exec(final Tuple input); final org.apache.pig.impl.logicalLayer.schema.Schema outputSchema(final org.apache.pig.impl.logicalLayer.schema.Schema input);  }