}
private static Type convertType(final String name, final TypeInfo typeInfo, final Repetition repetition) {
if (typeInfo.getCategory().equals(Category.PRIMITIVE)) {
if (typeInfo.equals(TypeInfoFactory.stringTypeInfo)) {
return new PrimitiveType(repetition, PrimitiveTypeName.BINARY, name, OriginalType.UTF8);
} else if (typeInfo.equals(TypeInfoFactory.intTypeInfo) ||
typeInfo.equals(TypeInfoFactory.shortTypeInfo) ||
typeInfo.equals(TypeInfoFactory.byteTypeInfo)) {
return new PrimitiveType(repetition, PrimitiveTypeName.INT32, name);
} else if (typeInfo.equals(TypeInfoFactory.longTypeInfo)) {
return new PrimitiveType(repetition, PrimitiveTypeName.INT64, name);
} else if (typeInfo.equals(TypeInfoFactory.doubleTypeInfo)) {
return new PrimitiveType(repetition, PrimitiveTypeName.DOUBLE, name);
} else if (typeInfo.equals(TypeInfoFactory.floatTypeInfo)) {
return new PrimitiveType(repetition, PrimitiveTypeName.FLOAT, name);
} else if (typeInfo.equals(TypeInfoFactory.booleanTypeInfo)) {
return new PrimitiveType(repetition, PrimitiveTypeName.BOOLEAN, name);
} else if (typeInfo.equals(TypeInfoFactory.binaryTypeInfo)) {
// TODO : binaryTypeInfo is a byte array. Need to map it
throw new UnsupportedOperationException("Binary type not implemented");
} else if (typeInfo.equals(TypeInfoFactory.timestampTypeInfo)) {
return new PrimitiveType(repetition, PrimitiveTypeName.INT96, name);
} else if (typeInfo.equals(TypeInfoFactory.voidTypeInfo)) {
throw new UnsupportedOperationException("Void type not implemented");
} else if (typeInfo.getTypeName().toLowerCase().startsWith(
serdeConstants.CHAR_TYPE_NAME)) {
return Types.optional(PrimitiveTypeName.BINARY).as(OriginalType.UTF8)