use of org.apache.inlong.sort.formats.inlongmsgcsv.InLongMsgCsvMixedFormatConverter in project incubator-inlong by apache.
the class MultiTenancyInLongMsgMixedDeserializer method generateDeserializer.
@VisibleForTesting
Pair<AbstractInLongMsgMixedFormatDeserializer, InLongMsgMixedFormatConverter> generateDeserializer(FieldInfo[] fields, InLongMsgDeserializationInfo inLongMsgDeserializationInfo) {
final RowFormatInfo rowFormatInfo = CommonUtils.generateDeserializationRowFormatInfo(fields);
final AbstractInLongMsgMixedFormatDeserializer preDeserializer;
final InLongMsgMixedFormatConverter deserializer;
if (inLongMsgDeserializationInfo instanceof InLongMsgCsvDeserializationInfo) {
final InLongMsgCsvDeserializationInfo csvDeserializationInfo = (InLongMsgCsvDeserializationInfo) inLongMsgDeserializationInfo;
preDeserializer = new InLongMsgCsvMixedFormatDeserializer(StandardCharsets.UTF_8.name(), csvDeserializationInfo.getDelimiter(), null, null, csvDeserializationInfo.isDeleteHeadDelimiter(), false);
deserializer = new InLongMsgCsvMixedFormatConverter(rowFormatInfo, DEFAULT_TIME_FIELD_NAME, DEFAULT_ATTRIBUTES_FIELD_NAME, null, false);
} else {
throw new UnsupportedOperationException("Not supported yet " + inLongMsgDeserializationInfo.getClass().getSimpleName());
}
return Pair.of(preDeserializer, deserializer);
}
Aggregations