@Test public void testDoubleTransform() { List<Writable> record = new ArrayList<>(); record.add(new Text("0.0")); List<Writable> transformed = Arrays.<Writable>asList(new DoubleWritable(0.0)); assertEquals(transformed, new ParseDoubleTransform().map(record)); }
@Override public List<Writable> map(List<Writable> writables) { List<Writable> transform = new ArrayList<>(); for (Writable w : writables) { if (w instanceof Text) { transform.add(new DoubleWritable(w.toDouble())); } else { transform.add(w); } } return transform; }
ParseDoubleTransform extends BaseTransform { @Override public List<Writable> map(List<Writable> writables) { List<Writable> transform = new ArrayList<>(); for (Writable w : writables) { if (w instanceof Text) { transform.add(new DoubleWritable(w.toDouble())); } else { transform.add(w); } } return transform; } }
ParseDoubleTransform extends BaseTransform { @Override public List<Writable> map(List<Writable> writables) { List<Writable> transform = new ArrayList<>(); for (Writable w : writables) { if (w instanceof Text) { transform.add(new DoubleWritable(w.toDouble())); } else { transform.add(w); } } return transform; }  }
ParseDoubleTransform extends BaseTransform { @Override public List<Writable> map(List<Writable> writables) { List<Writable> transform = new ArrayList<>(); for (Writable w : writables) { if (w instanceof Text) { transform.add(new DoubleWritable(w.toDouble())); } else { transform.add(w); } } return transform; }  @Override String toString(); @Override Schema transform(Schema inputSchema); @Override List<Writable> map(List<Writable> writables); @Override Object map(Object input); @Override Object mapSequence(Object sequence); @Override String outputColumnName(); @Override String[] outputColumnNames(); @Override String[] columnNames(); @Override String columnName(); }
ParseDoubleTransform extends BaseTransform { @Override public List<Writable> map(List<Writable> writables) { List<Writable> transform = new ArrayList<>(); for (Writable w : writables) { if (w instanceof Text) { transform.add(new DoubleWritable(w.toDouble())); } else { transform.add(w); } } return transform; }  @Override String toString(); @Override Schema transform(Schema inputSchema); @Override List<Writable> map(List<Writable> writables); @Override Object map(Object input); @Override Object mapSequence(Object sequence); @Override String outputColumnName(); @Override String[] outputColumnNames(); @Override String[] columnNames(); @Override String columnName();  }