@Test public void testDeSerialize2() throws StreamSerDeException { CSVSerDe csvSerDe = new CSVSerDe(); csvSerDe.setSchema(schema); SimpleSerDe deser = new SimpleSerDe(); deser.setSchema(schema); String s = "2,\"\"\"a\"\"\",\"\"\"b\"\"\""; List<Object[]> results = csvSerDe.deSerialize(s); assertTrue(results.get(0).length == 3); assertTrue(results.get(0)[0].equals("2")); assertTrue(results.get(0)[1].equals("\"a\"")); assertTrue(results.get(0)[2].equals("\"b\"")); }
@Override public List< Object[] > deSerialize(Object data) throws StreamSerDeException { if (data == null) { LOG.info("Input raw data is null."); return nullResults; } List< Object[] > vals; try { vals = CSVLineParser.parseCsv((String)data); } catch (IOException e) { throw new StreamSerDeException(e); } return createAllInstance(vals); }
CSVSerDe extends BaseSerDe { @Override public List< Object[] > deSerialize(Object data) throws StreamSerDeException { if (data == null) { LOG.info("Input raw data is null."); return nullResults; } List< Object[] > vals; try { vals = CSVLineParser.parseCsv((String)data); } catch (IOException e) { throw new StreamSerDeException(e); } return createAllInstance(vals); } }
CSVSerDe extends BaseSerDe { @Override public List< Object[] > deSerialize(Object data) throws StreamSerDeException { if (data == null) { LOG.info("Input raw data is null."); return nullResults; } List< Object[] > vals; try { vals = CSVLineParser.parseCsv((String)data); } catch (IOException e) { throw new StreamSerDeException(e); } return createAllInstance(vals); }  }
CSVSerDe extends BaseSerDe { @Override public List< Object[] > deSerialize(Object data) throws StreamSerDeException { if (data == null) { LOG.info("Input raw data is null."); return nullResults; } List< Object[] > vals; try { vals = CSVLineParser.parseCsv((String)data); } catch (IOException e) { throw new StreamSerDeException(e); } return createAllInstance(vals); }  @Override void setConfig(StreamingConfig conf); @Override void initialize(); @Override List< Object[] > deSerialize(Object data); @Override Object serialize(List< Object[] > events); }
CSVSerDe extends BaseSerDe { @Override public List< Object[] > deSerialize(Object data) throws StreamSerDeException { if (data == null) { LOG.info("Input raw data is null."); return nullResults; } List< Object[] > vals; try { vals = CSVLineParser.parseCsv((String)data); } catch (IOException e) { throw new StreamSerDeException(e); } return createAllInstance(vals); }  @Override void setConfig(StreamingConfig conf); @Override void initialize(); @Override List< Object[] > deSerialize(Object data); @Override Object serialize(List< Object[] > events); static final String LINE_SEPARATOR_UNIX; }