use of com.datastax.oss.dsbulk.codecs.api.ConvertingCodecFactory in project dsbulk by datastax.
the class StringToMapCodecTest method setUp.
@BeforeEach
void setUp() {
ConversionContext context = new TextConversionContext().setNullStrings("NULL").setFormatNumbers(true);
ConvertingCodecFactory codecFactory = new ConvertingCodecFactory(context);
codec = (StringToMapCodec<Double, List<String>>) codecFactory.<String, Map<Double, List<String>>>createConvertingCodec(DataTypes.mapOf(DataTypes.DOUBLE, DataTypes.listOf(DataTypes.TEXT)), GenericType.STRING, true);
}
use of com.datastax.oss.dsbulk.codecs.api.ConvertingCodecFactory in project dsbulk by datastax.
the class StringToSetCodecTest method setUp.
@BeforeEach
void setUp() {
ConversionContext context = new TextConversionContext().setNullStrings("NULL");
ConvertingCodecFactory codecFactory = new ConvertingCodecFactory(context);
codec1 = (StringToSetCodec<Double>) codecFactory.<String, Set<Double>>createConvertingCodec(DataTypes.setOf(DataTypes.DOUBLE), GenericType.STRING, true);
codec2 = (StringToSetCodec<String>) codecFactory.<String, Set<String>>createConvertingCodec(DataTypes.setOf(DataTypes.TEXT), GenericType.STRING, true);
}
use of com.datastax.oss.dsbulk.codecs.api.ConvertingCodecFactory in project dsbulk by datastax.
the class StringToTupleCodecTest method setUp.
@BeforeEach
void setUp() {
tupleType = DriverUtils.mockTupleType(DefaultProtocolVersion.V4, CodecRegistry.DEFAULT, DataTypes.TIMESTAMP, DataTypes.TEXT);
ConversionContext context1 = new TextConversionContext().setNullStrings("NULL", "");
ConversionContext context2 = new TextConversionContext().setAllowExtraFields(true);
ConversionContext context3 = new TextConversionContext().setAllowMissingFields(true);
codec1 = (StringToTupleCodec) new ConvertingCodecFactory(context1).<String, TupleValue>createConvertingCodec(tupleType, GenericType.STRING, true);
codec2 = (StringToTupleCodec) new ConvertingCodecFactory(context2).<String, TupleValue>createConvertingCodec(tupleType, GenericType.STRING, true);
codec3 = (StringToTupleCodec) new ConvertingCodecFactory(context3).<String, TupleValue>createConvertingCodec(tupleType, GenericType.STRING, true);
}
use of com.datastax.oss.dsbulk.codecs.api.ConvertingCodecFactory in project dsbulk by datastax.
the class StringToBigDecimalCodecTest method setUp.
@BeforeEach
void setUp() {
ConversionContext context = new TextConversionContext().setNullStrings("NULL").setFormatNumbers(true);
ConvertingCodecFactory codecFactory = new ConvertingCodecFactory(context);
codec = (StringToBigDecimalCodec) codecFactory.<String, BigDecimal>createConvertingCodec(DataTypes.DECIMAL, GenericType.STRING, true);
}
use of com.datastax.oss.dsbulk.codecs.api.ConvertingCodecFactory in project dsbulk by datastax.
the class StringToBigIntegerCodecTest method setUp.
@BeforeEach
void setUp() {
ConversionContext context = new TextConversionContext().setNullStrings("NULL").setFormatNumbers(true);
ConvertingCodecFactory codecFactory = new ConvertingCodecFactory(context);
codec = (StringToBigIntegerCodec) codecFactory.<String, BigInteger>createConvertingCodec(DataTypes.VARINT, GenericType.STRING, true);
}
Aggregations