use of com.datastax.oss.dsbulk.codecs.api.ConversionContext in project dsbulk by datastax.
the class StringToShortCodecTest method setUp.
@BeforeEach
void setUp() {
ConversionContext context = new TextConversionContext().setNullStrings("NULL").setFormatNumbers(true);
ConvertingCodecFactory codecFactory = new ConvertingCodecFactory(context);
codec = (StringToShortCodec) codecFactory.<String, Short>createConvertingCodec(DataTypes.SMALLINT, GenericType.STRING, true);
}
use of com.datastax.oss.dsbulk.codecs.api.ConversionContext in project dsbulk by datastax.
the class StringToUDTCodecTest method setUp.
@BeforeEach
void setUp() {
ConversionContext context1 = new TextConversionContext().setNullStrings("NULL", "");
ConversionContext context2 = new TextConversionContext().setAllowExtraFields(true);
ConversionContext context3 = new TextConversionContext().setAllowMissingFields(true);
ConvertingCodecFactory codecFactory1 = new ConvertingCodecFactory(context1);
ConvertingCodecFactory codecFactory2 = new ConvertingCodecFactory(context2);
ConvertingCodecFactory codecFactory3 = new ConvertingCodecFactory(context3);
udtCodec1 = (StringToUDTCodec) codecFactory1.<String, UdtValue>createConvertingCodec(udt1, GenericType.STRING, true);
udtCodec2 = (StringToUDTCodec) codecFactory1.<String, UdtValue>createConvertingCodec(udt2, GenericType.STRING, true);
udtCodec3 = (StringToUDTCodec) codecFactory2.<String, UdtValue>createConvertingCodec(udt3, GenericType.STRING, true);
udtCodec4 = (StringToUDTCodec) codecFactory3.<String, UdtValue>createConvertingCodec(udt4, GenericType.STRING, true);
}
Aggregations