use of com.datastax.oss.dsbulk.codecs.text.TextConversionContext 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.text.TextConversionContext 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.text.TextConversionContext 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);
}
use of com.datastax.oss.dsbulk.codecs.text.TextConversionContext in project dsbulk by datastax.
the class StringToByteCodecTest method setUp.
@BeforeEach
void setUp() {
ConversionContext context = new TextConversionContext().setNullStrings("NULL");
ConvertingCodecFactory codecFactory = new ConvertingCodecFactory(context);
codec = (StringToByteCodec) codecFactory.<String, Byte>createConvertingCodec(DataTypes.TINYINT, GenericType.STRING, true);
}
use of com.datastax.oss.dsbulk.codecs.text.TextConversionContext in project dsbulk by datastax.
the class StringToDoubleCodecTest method setUp.
@BeforeEach
void setUp() {
ConversionContext context = new TextConversionContext().setNullStrings("NULL").setFormatNumbers(true).setRoundingMode(HALF_EVEN);
ConvertingCodecFactory codecFactory = new ConvertingCodecFactory(context);
codec = (StringToDoubleCodec) codecFactory.<String, Double>createConvertingCodec(DataTypes.DOUBLE, GenericType.STRING, true);
}
Aggregations