CSVIntermediateDataFormat extends IntermediateDataFormat<String> { @Override public void setObjectData(Object[] data) { super.validateSchema(schema); this.data = toCSV(data); } CSVIntermediateDataFormat();  CSVIntermediateDataFormat(Schema schema); @Override String getCSVTextData(); @Override void setCSVTextData(String csvText); @Override Object[] getObjectData(); @Override void setObjectData(Object[] data); @Override void write(DataOutput out); @Override void read(DataInput in); @Override Set<String> getJars(); static final Logger LOG; }
@Test(expectedExceptions = SqoopException.class) public void testNotSettingSchemaAndSetObjectData() { dataFormat = new CSVIntermediateDataFormat(); dataFormat.setObjectData(null); }
@Test(expectedExceptions = SqoopException.class) public void testSchemaNotNullable() { dataFormat = new CSVIntermediateDataFormat(); dataFormat.setSchema(new Schema("Test").addColumn(new Text("t").setNullable(false))); Object[] out = new Object[1]; out[0] = null; dataFormat.setObjectData(out); }