* @param sb StringBuilder to hold the generated struct
* @throws SerDeException if something goes wrong while generating the struct
* */
private static void generateAvroStructFromSchema(Schema schema, StringBuilder sb)
throws SerDeException {
AvroObjectInspectorGenerator avig = new AvroObjectInspectorGenerator(schema);
sb.append("struct<");
// Get the column names and their corresponding types
List<String> columnNames = avig.getColumnNames();
List<TypeInfo> columnTypes = avig.getColumnTypes();
if (columnNames.size() != columnTypes.size()) {
throw new AssertionError("The number of column names should be the same as column types");
}