use of com.datastax.oss.dsbulk.codecs.text.TextConversionContext in project dsbulk by datastax.
the class StringToListCodecTest method setUp.
@BeforeEach
void setUp() {
ConversionContext context = new TextConversionContext().setNullStrings("NULL");
ConvertingCodecFactory codecFactory = new ConvertingCodecFactory(context);
codec1 = (StringToListCodec<Double>) codecFactory.<String, List<Double>>createConvertingCodec(DataTypes.listOf(DataTypes.DOUBLE), GenericType.STRING, true);
codec2 = (StringToListCodec<Instant>) codecFactory.<String, List<Instant>>createConvertingCodec(DataTypes.listOf(DataTypes.TIMESTAMP), GenericType.STRING, true);
codec3 = (StringToListCodec<String>) codecFactory.<String, List<String>>createConvertingCodec(DataTypes.listOf(DataTypes.TEXT), GenericType.STRING, true);
}
use of com.datastax.oss.dsbulk.codecs.text.TextConversionContext in project dsbulk by datastax.
the class StringToLongCodecTest method setUp.
@BeforeEach
void setUp() {
ConversionContext context = new TextConversionContext().setNullStrings("NULL").setFormatNumbers(true);
ConvertingCodecFactory codecFactory = new ConvertingCodecFactory(context);
codec = (StringToLongCodec) codecFactory.<String, Long>createConvertingCodec(DataTypes.BIGINT, GenericType.STRING, true);
}
use of com.datastax.oss.dsbulk.codecs.text.TextConversionContext 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.text.TextConversionContext 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