use of io.cdap.cdap.api.data.format.FormatSpecification in project cdap by caskdata.
the class DelimitedStringsRecordFormatTest method testRecordMappingWithNonSimpleSchema.
@Test(expected = IllegalArgumentException.class)
public void testRecordMappingWithNonSimpleSchema() throws UnsupportedTypeException {
Schema arraySchema = Schema.arrayOf(Schema.of(Schema.Type.STRING));
Schema schema = Schema.recordOf("event", Schema.Field.of("f1", arraySchema));
FormatSpecification formatSpec = new FormatSpecification(DelimitedStringsRecordFormat.class.getCanonicalName(), schema, ImmutableMap.of(DelimitedStringsRecordFormat.MAPPING, "0:f1"));
DelimitedStringsRecordFormat format = new DelimitedStringsRecordFormat();
format.initialize(formatSpec);
}
use of io.cdap.cdap.api.data.format.FormatSpecification in project cdap by caskdata.
the class DelimitedStringsRecordFormatTest method testRecordMappingWrongMapping.
@Test(expected = IllegalArgumentException.class)
public void testRecordMappingWrongMapping() throws UnsupportedTypeException {
Schema arraySchema = Schema.arrayOf(Schema.of(Schema.Type.STRING));
Schema schema = Schema.recordOf("event", Schema.Field.of("f1", arraySchema));
FormatSpecification formatSpec = new FormatSpecification(DelimitedStringsRecordFormat.class.getCanonicalName(), schema, ImmutableMap.of(DelimitedStringsRecordFormat.MAPPING, "0:f2"));
DelimitedStringsRecordFormat format = new DelimitedStringsRecordFormat();
format.initialize(formatSpec);
}
Aggregations